En Wed, 14 Oct 2009 05:19:06 -0300, Ulrich Eckhardt
<eckha...@satorlaser.com> escribió:

Gabriel Genellina wrote:
#ifdef _DEBUG
#undef _DEBUG
#include <Python.h>
#define _DEBUG
#else
#include <Python.h>
#endif
[...to keep Python from linking against non-existant debug libraries.]

No, don't do that. Just compile your application in release mode.

Why not, does it break anything?

You have to ensure the same block is used everywhere <Python.h> is
included, or remember to always use "mypython.h", but there is still the
risk when adding some other external library.
The object layout is different in a debug build, and there are other
incompatible differences. Mixing code compiled in both modes hopefully
would generate a linker error, but if not, it may crash the application.
The debug flag for Python *should* be decoupled from the debug flag for
the application embedding it, but unfortunately it isn't. There is a
feature request at http://bugs.python.org (the site doesn't work for me
now)

--
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to