Linking debug C++ DLL with python dlls

Mathieu Gontier mg.mailing-list at laposte.net
Thu Nov 8 15:03:48 EST 2007


Hello,

I often build Python on Windows.

What I can say is it not so trivial to build debug libraries for Python: 
each debug library must have the postfix *_d.dll/.pyd.

Another useful information. On Windows, a shared library is linked to 
our application though a associated file with the .lib extension. This 
"static library" contains all the information relating to de 
__declspec(import) / __declspec(export) instructions you should add in 
the code. The most important in Python is that the shared libraries 
(usually with the extension .dll) have as extension .pyd.
So, you can change it in Visual Studio.


Mathieu Gontier
Core Development Engineer

Read the attached v-card for telephone, fax, adress
Look at our web-site http://www.fft.be
 



brzrkr0 at gmail.com wrote:
> On Nov 8, 4:07 am, mosheha... at gmail.com wrote:
>   
>> I tried to change the code above (just for fun) so in both cases i'll
>> use python25.lib and in debug compilation I got linker errors on
>> unresolved externals. seems like the debug version exports more
>> methods than the release version.
>>     
>
> I usually just build my extensions in release mode and avoid using the
> debugger.  Getting a copy of python24_d.lib (in my case) and building
> a debug version of my extension isn't a big deal, but afaik all my
> other extensions (wxPython, numpy, etc) have to be built in debug mode
> as well in order for things to work.
>
> If you find a good solution, please post it to the group because I'd
> like to know how to do this as well.
>
> -Casey
>
>   



More information about the Python-list mailing list