[wxPython] compile a wxWindows app using VC++ "Hybrid"

Hi ,
I am trying to compile a wxWindows application which links against python
(wxPython) libs.
For Debug-DLL and Release-DLL it links fine but when I try the "hybrid"
setting I get these linker errors:

omx_app.obj : error LNK2001: unresolved external symbol __imp___Py_Dealloc
omx_swig_wrap.obj : error LNK2001: unresolved external symbol
__imp___Py_Dealloc
omx_app.obj : error LNK2001: unresolved external symbol __imp___Py_RefTotal
omx_swig_wrap.obj : error LNK2001: unresolved external symbol
__imp___Py_RefTotal
omx_swig_wrap.obj : error LNK2001: unresolved external symbol
__imp__Py_InitModule4TraceRefs
HybridDLL/omx.exe : fatal error LNK1120: 3 unresolved externals

By "Hybrid" I mean putting debug information into _my_ code but using the
non-debug version of Microsoft's c-lib and of python.
The idea is that I want to be able to debug my code while still being able
to use the standard python22.dll lib.

Any hints anyone?

Thanks,
Sebastian Haase

Sebastian Haase wrote:

Hi ,
I am trying to compile a wxWindows application which links against python
(wxPython) libs.
For Debug-DLL and Release-DLL it links fine but when I try the "hybrid"
setting I get these linker errors:

[...]

By "Hybrid" I mean putting debug information into _my_ code but using the
non-debug version of Microsoft's c-lib and of python.
The idea is that I want to be able to debug my code while still being able
to use the standard python22.dll lib.

Any hints anyone?

First of all, are you using this?

http://prdownloads.sf.net/wxpython/wxPythonWIN32-devel-2.3.3.1.tar.gz

The main thing to check is that you are using the /MD flag to specify the non-debug version of the c-lib, and /Od /Zi (I think) to get debug info. If you want to use the same wx DLL that wxPython does then you'll want to use the headers and import lib in the package above.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

I actually am using some 2.3.3_preX version both of wxWindows and on
wxPython.
Also I have made sure to use the correct compiler settings: /MD /Od ... (I
have it so that I can't see a difference to the settings of debug-DLL -
with exception of /Od and /ZI - I think)
And therefore what I'm really wondering about is:
when release links fine - why doesn't hybrid link - if I don't even see any
different settings ?
(( I remember that I changed the Python.h file so that I specifically _have_
to list python22.lib as linked library. - but again, what ever I've done
there works for release and for hybrid !!)
What is actually missing when the linker complains this: (i.e. he missed
only specific py-functions - not all!!)

omx_app.obj : error LNK2001: unresolved external symbol __imp___Py_Dealloc
omx_swig_wrap.obj : error LNK2001: unresolved external symbol
__imp___Py_Dealloc
omx_app.obj : error LNK2001: unresolved external symbol __imp___Py_RefTotal
omx_swig_wrap.obj : error LNK2001: unresolved external symbol
__imp___Py_RefTotal
omx_swig_wrap.obj : error LNK2001: unresolved external symbol
__imp__Py_InitModule4TraceRefs
HybridDLL/omx.exe : fatal error LNK1120: 3 unresolved externals

thanks,
Sebastian

But what I'm really wondering about

···

----- Original Message -----
From: "Robin Dunn" <robin@alldunn.com>
To: <wxpython-users@lists.wxwindows.org>
Sent: Tuesday, October 08, 2002 7:02 PM
Subject: Re: [wxPython] compile a wxWindows app using VC++ "Hybrid"

Sebastian Haase wrote:
> Hi ,
> I am trying to compile a wxWindows application which links against

python

> (wxPython) libs.
> For Debug-DLL and Release-DLL it links fine but when I try the

"hybrid"

> setting I get these linker errors:
>

[...]

> By "Hybrid" I mean putting debug information into _my_ code but using

the

> non-debug version of Microsoft's c-lib and of python.
> The idea is that I want to be able to debug my code while still being

able

> to use the standard python22.dll lib.
>
> Any hints anyone?

First of all, are you using this?

Download wxPythonWIN32-devel-2.3.3.1.tar.gz (wxPython)

The main thing to check is that you are using the /MD flag to specify
the non-debug version of the c-lib, and /Od /Zi (I think) to get debug
info. If you want to use the same wx DLL that wxPython does then you'll
want to use the headers and import lib in the package above.

Sebastian Haase wrote:

I actually am using some 2.3.3_preX version both of wxWindows and on
wxPython.
Also I have made sure to use the correct compiler settings: /MD /Od ... (I
have it so that I can't see a difference to the settings of debug-DLL -
with exception of /Od and /ZI - I think)
And therefore what I'm really wondering about is:
when release links fine - why doesn't hybrid link - if I don't even see any
different settings ?

Actually, what you want to do is make your settings the same as Release with the exception of adding the flags needed to get debugging symbols generated and adding -D__WXDEBUG__. The missing symbols you mention are from Python and I expect that some debug mode setting is causing them to be defined in the Python headers but when you link with the release version of Python they are missing.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!