Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Distutils gcc error

Reply
Thread Tools

Distutils gcc error

 
 
Brian Victor
Guest
Posts: n/a
 
      07-14-2003
I am attempting to distribute my wxPython program with the aid of
distutils. I have one C++ module that needs to built on the user's
machine. 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])

If anyone can point me to a fix, I would appreciate it. Thanks in advance!

--
Brian
 
Reply With Quote
 
 
 
 
Brian Victor
Guest
Posts: n/a
 
      07-15-2003
Following up to myself for googling purposes.

Brian Victor wrote:
> 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])


The compiler was taking the chunk of arguments returned by wx-config as
one large, nonsensical argument. This is solved by using:

extra_link_args=wxlibs.split(),
extra_compile_args=wxcxxflags.split())

--
Brian
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
distutils, No module named numpy.distutils.fcompiler.conv_template Luis Alberto Zarrabeitia Gomez Python 0 03-30-2009 03:56 PM
[ANN] GCC 4.1.2 installer for Python distutils compilation Giovanni Bajo Python 3 03-23-2007 04:24 PM
can distutils windows installer invoke another distutils windows installer timw.google Python 1 05-11-2006 10:07 PM
gcc 2.95 and gcc 3.2 gouqizi.lvcha@gmail.com C++ 8 03-16-2005 02:34 AM
C99 structure initialization in gcc-2.95.3 vs gcc-3.3.1 Kevin P. Fleming C Programming 2 11-06-2003 05:15 AM



Advertisments