« Return to Thread: link error in debug mode

Re: link error in debug mode

by Themistoklis Bourdenas :: Rate this Message:

Reply to Author | View in Thread

Well having a windows system I've downloaded the python source and build
with VS a debug version of python24_d.lib instead of what you've
described below. I linked my module with this lib but I still get the
linking errors.

 >>> Or, just be sure you don't use any macro that enables the python
debug mode.
I can't say that I've understood what I am supposed to do? Where do I
use these macros?

Marcelo Matus wrote:

> When using the debug mode, probably you are using a
> Py_DEBUG/Py_TRACE_REFS
> macros or so that  enable the python debug mode, but you are still
> linking against the
> plain python library.
>
> Hence, you need to have two python installation, one with debug mode
> (configure using --with-pydebug or so) and one plain or release python
> version.
> You can install the debug version using a directory like
>
>   ./confiigure --prefix=/usr/local/python-2.4.1-dbg  --with-pydebug
> ..(or so)
>
> When compiling the debug version of your module, be sure you link against
> the proper debug python library, ie, add something like
>
>  -L/usr/local/python-2.4.1-dbg/lib/python2.4/config/ -lpython2.4
>
> Or, just be sure you don't use any macro that enables the python debug
> mode.
> Marcelo
>
> Themistoklis Bourdenas wrote:
>
>> Hi I export some C++ classes with swig to python and then try to
>> compile the module. However I get linking errors in debug mode.
>> However when compiling in release mode (VS2005) everything compiles
>> smoothly and my module is working properly. Any idea why does this
>> happens?
>>
>> The linking errors I get in debug mode are following:
>> pyMage_wrap.obj : error LNK2019: unresolved external symbol
>> __imp___Py_Dealloc referenced in function _PySwigObject_format
>> pyMage_wrap.obj : error LNK2019: unresolved external symbol
>> __imp___Py_NegativeRefcount referenced in function _PySwigObject_format
>> pyMage_wrap.obj : error LNK2001: unresolved external symbol
>> __imp___Py_RefTotal
>> pyMage_wrap.obj : error LNK2019: unresolved external symbol
>> __imp___PyObject_DebugFree referenced in function _PySwigObject_dealloc
>> pyMage_wrap.obj : error LNK2019: unresolved external symbol
>> __imp___PyObject_DebugMalloc referenced in function _PySwigObject_New
>> pyMage_wrap.obj : error LNK2019: unresolved external symbol
>> __imp__Py_InitModule4TraceRefs referenced in function _init_pyMage
>>
>> It seems that python library is missing but how does it work in
>> release mode?
>>
>> Thanks in advance.
>>
>>
>> -------------------------------------------------------
>> This SF.Net email is sponsored by xPML, a groundbreaking scripting
>> language
>> that extends applications into web and mobile media. Attend the live
>> webcast
>> and join the prime developer group breaking into this new coding
>> territory!
>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
>> _______________________________________________
>> Swig-user mailing list
>> Swig-user@...
>> https://lists.sourceforge.net/lists/listinfo/swig-user
>
>
>



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Swig-user mailing list
Swig-user@...
https://lists.sourceforge.net/lists/listinfo/swig-user

 « Return to Thread: link error in debug mode