473,387 Members | 1,528 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Distutils gcc error

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
Jul 18 '05 #1
1 1691
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
Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Andrew Gregory | last post by:
In Python 2.2, I compiled some C++ code on Windows (MinGW compiler) to create an extension using distutils and the following setup.py file: from distutils.core import setup, Extension setup...
0
by: Jorge Godoy | last post by:
Hi! For the following setup.py, I get this error: byte-compiling /var/tmp/bhsys-buildroot/usr/lib/python2.3/site-packages/bhsys/Impressao.py to Impressao.pyc byte-compiling...
1
by: Mathieu Malaterre | last post by:
Hello, I thought this would be easy but I guess I didn't get the distutil feeling. I am trying to write a setup for install my package but I don't understand how to do that. organisation: ...
1
by: Terry Hancock | last post by:
Some time ago, I got the idea that I wanted to build image resources from vector graphic originals, instead of marshalling hundreds of tiny little icon images by hand. I wrote "BuildImage" to do...
1
by: Martin Bless | last post by:
Now that I've got my extension building machine using the VC++ Toolkit 2003 up and running I'm keen on using Pyrex (Pyrex-0.9.3, Python-2.4.0). But the definition of the swig_sources() method...
0
by: Glenn Pierce | last post by:
Hi I have a question about writing a portable setup.py script for distutils. I have a directory structure like this. FreeImage/ |----------Source/ | |------ FreeImage.h |...
6
by: ajikoe | last post by:
Hello I tried to combine c++ and python together. So I follow from this website: http://kortis.to/radix/python_ext/ I have this code: # prmodule.c static PyObject *pr_isprime(PyObject *self,...
9
by: jtravs | last post by:
Hi all, I suspect that I'm doing something stupid, I would like some other opinions though. I'm getting started with ctypes and am trying to use distutils to help build my module. At the moment...
7
by: vedrandekovic | last post by:
Hello again, Is there any patch for python "distutils", for this ImportError: cannot import name log Regards, Vedran
0
by: newbie73 | last post by:
OS: Vista Python 2.5.2.2 (ActiveState Software Installation) Running latest Cygwin release The error generated is pasted below - please help. - Luis ***************************************
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.