distutils on win32 with link.exe -- use dlls?

J

John Hunter

I am using distutils to build a python extension module on win32. I
initialize the Extension class with a list of libraries with

Extension("_gd", ["_gdmodule.c"],
include_dirs=incdirs, library_dirs=libdirs,
libraries=libs, define_macros=macros)],

and am using VC6++ where libs is a list ['gd', 'png', ...]. Distutils
produces a link command with the required libraries as

link.exe blahblah gd.lib png.lib jpeg.lib blahblah

However, I have DLL versions of these libraries in my library path,
ie, libgd.dll, libjpeg.dll, etc...

Is there a macro or compile flag or other setting to inform distutils
to look for the DLLS of the required libraries rather than the *.lib
files?

Thanks,
John Hunter
 
D

David Bolen

John Hunter said:
Is there a macro or compile flag or other setting to inform distutils
to look for the DLLS of the required libraries rather than the *.lib
files?

Under Windows, even if your resultant binary is going to use DLLs, you
need to link against the export libraries provided for those DLLs.
The export libraries only contain the external entry points into the
DLLs and a reference to the DLL, but they are still separate .lib
files that are necessary to build code to run against the DLLs. Thus,
anyone who provides DLLs for other source to use should also be
providing the matching .libs (or if you are building the DLLs from
source, the build process should also create matching .lib files).

-- David
 
C

Chris Liechti

David Bolen said:
Under Windows, even if your resultant binary is going to use DLLs, you
need to link against the export libraries provided for those DLLs.
The export libraries only contain the external entry points into the
DLLs and a reference to the DLL, but they are still separate .lib
files that are necessary to build code to run against the DLLs. Thus,
anyone who provides DLLs for other source to use should also be
providing the matching .libs (or if you are building the DLLs from
source, the build process should also create matching .lib files).

the current gcc in cygwin/mingw can link directly against DLLs (it creates
the imp lib on the fly) one reason more to use free software ;-)

chris
 
T

Thomas Heller

Chris Liechti said:
the current gcc in cygwin/mingw can link directly against DLLs (it creates
the imp lib on the fly) one reason more to use free software ;-)

Can these implibs be used by MSVC?

Thomas
 
C

Chris Liechti

Can these implibs be used by MSVC?

it does not strore them on the disk in that case.
there are separate tools to generate import libs too but the msvc onces and
the gnu ones are NOT compatible.

chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,164
Messages
2,570,898
Members
47,439
Latest member
shasuze

Latest Threads

Top