Thomas Heller wrote:
D:\bin\lang\studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX -Isrc -ID:\bin\lang\Python\Include /Tcsrc/_glumodule.c /Fobuild\temp.win32\Release\src/_glumodule.obj
Doesn't work. The GUI under the old BUILD.py uses:
/nologo /MD /W3 /GX /O2 /Ob2 /I "D:\bin\lang\Python\include" /D "WIN32" /D "_WINDOWS" /D "NDEBUG" /Fp"tmp\./_glu.pch" /YX /Fo"tmp\./" /Fd"tmp\./" /FD /c
and works fine.
This is not related to C/C++ problems. The problem is that WIN32 and _WINDOWS is not defined in the first run. Insert the define_macros parameter: Extension("_glu", ["src/_glumodule.c"], libraries=glu_libs, library_dirs=glu_lib_dirs, define_macros=[("WIN32", None), ("_WINDOWS", None)], ), in your setup-script and it should work. (This may also be necessary for other extensions).
'define_macros' only works with the latest version of distutils.
May be you should use the same include order as in the other
c-files.
(This file fails to compile.)
* _glumodule.c *******************
...
#ifdef WIN32
#include