Using Windows .DLLs in Linux C++ code - possible?

Jeremy White jwhite at codeweavers.com
Fri Nov 18 17:04:02 CST 2005


Hi Jim,

You might actually do best turning the problem upside down.

That is, it's quite easy to write a .exe or winelib
application that links to a Windows DLL and connects
to a Linux binary or library.

It's hard to call Wine as a library, because Wine has
to have quite a lot initialized (that's code for
you really don't even want to try :-/).

Hence, if you think of the problem as one of having
a Winelib app call your Linux C++ code, you'll
probably succeed.

On a different tangent, though, if I were in your shoes,
I'd write a simple Windows .EXE file (and test + debug it
on Windows) that used this DLL to communicate with this device
but then took commands via a socket interface.

You can write the code on the Linux side to operate
the socket interface, and once it's working well with
a Windows device, step over and get it to work with
Wine as well.  That lets you eliminate Wine's bugs
from your own development effort initially, but then
later circle around to make sure you get them out.

Others may argue you should start with a Winelib
app first and foremost, and they'd be morally right;
I'm just trying to be practical.
<grin>

Cheers,

Jeremy

Jim Morash wrote:
> Is it possible, via Wine, to link against a Windows DLL in a C++
> program compiled under Linux? My specific situation: I would like to
> interface a piece of hardware over a serial port. The manufacturer
> refuses to provide a serial comms specification for the device "because
> it's proprietary", but they will happily provide a Windows DLL that can
> be used to control the device. Any chance of using it under Linux?
>  thanks
> 
> --Jim Morash
> 
> 
> 
> ------------------------------------------------------------------------
> 
> 




More information about the wine-devel mailing list