[Distutils] Help: request for assistance with PyOpenGL distribution using distutils on NT

Thomas Heller thomas.heller@ion-tof.com
Mon Sep 18 04:43:02 2000


>
> 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).

Thomas