Using Windows .DLLs in Linux C++ code - possible?
Alex Villacís Lasso
a_villacis at palosanto.com
Fri Nov 18 18:06:33 CST 2005
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
>
>
>
>
I think you may build a winelib application that uses LoadLibrary() to
load the DLL at runtime, then query the entry points for the interesting
functions. You can even use C++ (wineg++). But if I were in your case
(unknown protocol over standard serial port, no specs from
manufacturer), I would consider compiling bochs
(http://bochs.sourceforge.net/), installing Windows inside, along with a
win32 app that uses the port, then modify bochs in order to log the
serial port communication between the virtual machine and the hardware
port. If the DLL is the only thing that ties you to Windows, then you
would be the proud owner of a native Linux program that interacts with
the hardware. I know this is possible, because I did the exact same
thing in order to figure out a parallel-port protocol for a MP3 player
that was initially Windows-only.
Alex Villacis Lasso
More information about the wine-devel
mailing list