I posted this to comp.lang.python but haven't gotten a response yet, and
since it's relevant to the wxPython community, I'm posting it here in
case someone has dealt with or could learn from it.
I succeeded in building a wx C++ module for wxPython and am now
attempting to distribute it with distutils. In order to avoid the need
for the user to have the wxPython source tree, I'm including wxPython.h
and helpers.h in my distribution. (Should this be ok?)
At any rate, when I run "./setup.py build", the following appears on the
terminal:
gcc -DNDEBUG -DNDEBUG -g -O3 -Wall -Wstrict-prototypes
-fno-strict-aliasing -fPIC -Isrc -I/usr/include/python2.2 -c src/bwaa.cc
-o build/temp.linux-ppc-2.2/bwaa.o -I/usr/local/lib/wx/include/gtk-2.4
-DGTK_NO_CHECK_CASTS -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES
[snip]
/usr/local/include/wx/setup.h:15: #error No __WXxxx__ define set! Please
define one of
__WXBASE__,__WXGTK__,__WXMSW__,__WXMOTIF__,__WXMAC__,__WXQT__,__WXPM__,__WXSTUBS
···
__
That error message is consistent with failure to define __WXGTK__.
However, that macro is clearly defined on the command line, and copying
and pasting that line into the terminal causes the build to succeed.
Why would that be?
This is how I have the extention defined in my setup.py file:
wxlibs = commands.getoutput("wx-config --libs")
wxcxxflags = commands.getoutput("wx-config --cxxflags")
bwaaext = Extension("bwaascalec", ["src/bwaa.cc", "src/bwaascale.cc"],
include_dirs=["src"],
extra_link_args=[wxlibs],
extra_compile_args=[wxcxxflags])
[snip]
ext_modules=[bwaaext])
Anyone know what's going on here or how to fix it? TIA.
--
Brian