[Wine] Winelib application linking with non-system Windows DLL - how?

Adam Spragg adam.spragg at octaltelecom.co.uk
Wed Feb 24 11:06:40 CST 2010


Wine users,

I'm writing a winelib application, and trying to link with a non-system 
Windows DLL to resolve external symbols, and I can't figure out how to do it.

According to the documentation[0]:

"All the libraries you link with should be available as '.so' libraries. If 
one of them is available only in '.dll' form then consult Building WineLib 
DLLs."

which I think is my case. But "Building WineLib DLLs"[1] says:

"For one reason or another you may find yourself with a Linux library that you 
want to use as if it were a Windows Dll."

Uh, that's not what I want at all. I've got a Windows library that is in .dll 
form, and I want to link against it. In my Makefile, I've added the paths to 
the .lib file, the path to the .dll file, and the name of the DLL to include 
in what appear to be the right places from the documentation[2]. Although IMO 
the documentation isn't entirely clear on the intended semantics/usage of all 
the Makefile variables. For example, in the section describing hello_exe_DLLS, 
it claims:

"The DLLS field is where you would enumerate the list of DLLs that executable 
imports. It should contain the full DLL name including the '.dll' extension, 
but not the '-l' option."

This is in contrast to the default DLLs that winemaker already included in the 
list, which do *not* have the '.dll' extension. Nevertheless, I have tried to 
link against the library with and without the '.dll' extension, and it always 
fails.

My current Makefile is attached.

Note that without trying to link against sapi.dll, I get errors of the form:

sapi-speak.cpp:(.text+0x176): undefined reference to `SPDFID_WaveFormatEx'

If I do try to link against sapi.dll (which contains the above symbol), then 
depending on how I try to link it, I get one of:

/usr/bin/ld: cannot find -lsapi
/usr/bin/ld: cannot find -lsapi.dll

Note also the following output from my system:

adam at host:~/.wine/drive_c$ find . -iname sapi.*
./Program Files/Microsoft Speech SDK 5.1/Lib/i386/sapi.lib
./Program Files/Microsoft Speech SDK 5.1/Include/sapi.h
./Program Files/Microsoft Speech SDK 5.1/IDL/sapi.idl
./Program Files/Microsoft Speech SDK 5.1/Docs/Help/sapi.chm
./Program Files/Common Files/Microsoft Shared/Speech/sapi.dll
./Program Files/Common Files/Microsoft Shared/Speech/sapi.sym
./Program Files/Common Files/Microsoft Shared/Speech/sapi.pdb
./Program Files/Common Files/Microsoft Shared/Speech/sapi.cpl

I'm running wine-1.0.1 on Debian "testing" (Squeeze), wine package version 
1.0.1-2.


Can anyone figure out where I'm going wrong, and point me to the documentation 
I missed that tells me how I'm supposed to be doing this?

Ta,

Adam

[0] http://www.winehq.org/docs/winelib-guide/linking
[1] http://www.winehq.org/docs/winelib-guide/bindlls
[2] http://www.winehq.org/docs/winelib-guide/winelib-toolkit#MAKEFILE

-- 
Adam Spragg <adam.spragg at octaltelecom.co.uk>
Developer
Octal Telecom <http://www.octaltelecom.co.uk/>


It reverses the logical flow of conversation!
> Why?
> > No.
> > > Should I top post?
<http://www.google.com/search?q=%22top+posting%22>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile
Type: text/x-makefile
Size: 2726 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-users/attachments/20100224/41f0ae10/attachment.bin>


More information about the wine-users mailing list