471,336 Members | 1,254 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,336 software developers and data experts.

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


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

Jul 18 '05 #1
4 2885
John Hunter <jd******@ace.bsd.uchicago.edu> writes:
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
Jul 18 '05 #2
David Bolen <db**@fitlinxx.com> wrote in news:u6***********@fitlinxx.com:
John Hunter <jd******@ace.bsd.uchicago.edu> writes:
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).


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
--
Chris <cl******@gmx.net>

Jul 18 '05 #3
Chris Liechti <cl******@gmx.net> writes:
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
Jul 18 '05 #4
Thomas Heller <th*****@python.net> wrote in
news:is**********@python.net:
Chris Liechti <cl******@gmx.net> writes:
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?


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

--
Chris <cl******@gmx.net>

Jul 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Scott David Daniels | last post: by
reply views Thread by Glenn Pierce | last post: by
10 posts views Thread by Gary Jones | last post: by
8 posts views Thread by Jan | last post: by
9 posts views Thread by jtravs | last post: by
7 posts views Thread by Steven Bethard | last post: by
1 post views Thread by moshehaim1 | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.