473,544 Members | 1,767 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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=in cdirs, library_dirs=li bdirs,
libraries=libs, define_macros=m acros)],

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 3041
John Hunter <jd******@ace.b sd.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.co m:
John Hunter <jd******@ace.b sd.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.n et>

Jul 18 '05 #3
Chris Liechti <cl******@gmx.n et> 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.n et> 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.n et>

Jul 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2848
by: Scott David Daniels | last post by:
I'm trying to get distutils in 2.4 happy running mingw32. I've chased a few things down, but now I'm getting: C:\Documents and Settings\daniels\Desktop\Py\block>\python24\python setup.py bui ld_ext -cmingw32 running build_ext building '_block' extension C:\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\python24\include \...
0
1441
by: Glenn Pierce | last post by:
Hi I have a question about writing a portable setup.py script for distutils. I have a directory structure like this. FreeImage/ |----------Source/ | |------ FreeImage.h | |----------Dist/ | |------FreeImage.lib
10
2782
by: Gary Jones | last post by:
Hi, I'm trying to find my feet with C# and have hit a bit of a wall. I have lots of legacy code in a DLL written in Delphi. I don't think the fact that it's written in Delphi should cause too much of a problem since the code is just simple Pascal that does arithmetic and string manipulations, and all "strings" in the structures passed to...
8
1402
by: Jan | last post by:
We have a VB dll that invokes a C# dll. The C# dll references 3 other dlls - one is a .NET dll, the other two are win32 COM dlls. I have a script that invokes the VB dll which in turn successfully invokes the C# dll on my development machine. Next, I tried deploying to a stage server, but couldn't get the same test to work there. It...
3
1141
by: Jeff Stewart | last post by:
Is it possible, in VB.NET 2003 Standard, to link referenced DLLs statically, so I only have to distribute a single executable? -- Jeff S.
3
1092
by: ZaX | last post by:
Good day folks, I'm wondering what is the easiest way to link DLLs to a project with VB.NET. I've been building an app here (framework 1.1). In my project, I added a few references to files I've copied in my bin folder. The Copy Local property for the DLLs is set to true. Here, everything works fine.
9
4141
by: jtravs | last post by:
Hi all, I suspect that I'm doing something stupid, I would like some other opinions though. I'm getting started with ctypes and am trying to use distutils to help build my module. At the moment I simply want distutils to build a shared c library (not a python extension!). Under linux, the following works, under windows xp id doesn't (which...
7
2457
by: Steven Bethard | last post by:
How do I get distutils to include my testing module in just the "sdist" distribution? My current call to setup() looks like:: distutils.core.setup( ... py_modules=, ) If change this to::
1
3423
by: moshehaim1 | last post by:
Hi, I am working with C++ code that needs to be maintained both in debug and release versions. The environment is Windows 32 bit with MSVC8. I downloaded the python installation for Win32 and installed it. When, however, I tried to compile my DLLs in debug mode i got link errors specifying that I need the python25_d.lib. this is the...
0
7414
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7757
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7699
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5288
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4905
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3400
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1833
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
982
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
651
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.