building simple python 'embedding' in vc++6

Mark Hammond mhammond at skippinet.com.au
Wed May 28 23:38:58 EDT 2003


Bryan wrote:

> i had the same problem.  python22_d.lib is a debug version of the python
> library.   in your python/include folder, you'll find pyconfig.h.  in this
> file is a MS_WIN32 section with pragma's that include the libs for you.  i
> just comment out this entire section (IMHO what a awful way to include
> libs).

We do it this way as mixing debug and release libraries will cause 
untold grief for many people.

Note that you can also specify /NODEFAULTLIB:python22_d.lib to prevent 
the pragma from having any affect.

>  i then include the lib in the "normal" MSdev studio way.   i just
> link to the release build version (python22.lib) for both release and debug
> builds. i don't intend on debugging into the python library, so for me this
> isn't a problem. 

It has less to do with debugging, and more to do with ensuring the 
correct C runtime lib is being used.

If all you want is to debug your release builds, why not simply change 
the C++ options for that build to include debug info?  That is certainly 
a lot less risky than your advice.

Mark.





More information about the Python-list mailing list