From 7e1e07f34b2420e420e2858e5ea9a49fe1e0d235 Mon Sep 17 00:00:00 2001 From: John Stark Date: Thu, 17 Nov 2011 11:48:24 +0100 Subject: [PATCH] COMP: Fix compilation issue on VS2010 when PythonQt Debug build against python Release * Copied most of the contents of vtkPython.h to dPython.h --- src/dPython.h | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/dPython.h b/src/dPython.h index 2ee9ec81..1aa6e911 100644 --- a/src/dPython.h +++ b/src/dPython.h @@ -60,9 +60,28 @@ */ #ifdef _DEBUG +// Include these low level headers before undefing _DEBUG. Otherwise when doing +// a debug build against a release build of python the compiler will end up +// including these low level headers without DEBUG enabled, causing it to try +// and link release versions of this low level C api. +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include # undef _DEBUG # if defined(_MSC_VER) && _MSC_VER >= 1400 -# define _CRT_NOFORCE_MANIFEST 1 +# define _CRT_NOFORCE_MANIFEST 1 # endif # include # define _DEBUG @@ -70,4 +89,5 @@ # include #endif + #endif