Improve company productivity with a Business Account.Sign Up


wxPython build:  "parse error before" during Python setup

Posted on 2004-10-12
Medium Priority
Last Modified: 2013-12-27
Hey Guys,

I am in the process of installing wxPython on Solaris 9.  I was able to do a good configure and a successful make...however, the last step is to run a python setup, to integrate the wxPython tools with the Python install.  This is where I am having difficulty.  Here are the steps so far...


#./configure --prefix=$PREFIXDIR \
             --with-gtk \
             --enable-debug_flag \
             --enable-geometry \
             --enable-sound --with-sdl \
             --enable-display \
             --enable-optimize \
             --enable-rpath=$PREFIXDIR/lib \
             --enable-permissive \

...resulted in the output of ...

Configured wxWindows 2.5.1 for `sparc-sun-solaris2.9'

  Which GUI toolkit should wxWindows use?                 gtk
  Should wxWindows be compiled into single library?       no
  Should wxWindows be compiled in debug mode?             no
  Should wxWindows be linked as a shared library?         yes
  Should wxWindows be compiled in Unicode mode?           no
  What level of wxWindows compatibility should be enabled?
                                       wxWindows 2.2      no
                                       wxWindows 2.4      yes
  Which libraries should wxWindows use?
                                       jpeg               builtin
                                       png                builtin
                                       regex              sys
                                       tiff               builtin
                                       zlib               builtin
                                       odbc               no
                                       expat              builtin
                                       libmspack          no
                                       sdl                yes
... I then ran the following "make" script ...

make $* \
    && make -C contrib/src/gizmos $* \
    && make -C contrib/src/ogl CXXFLAGS="-DwxUSE_DEPRECATED=0" $* \
    && make -C contrib/src/stc $* \
    && make -C contrib/src/xrc $*
...with apparently successful output ...

HOWEVER, the final command to integrate Python with wxPython is giving the following problems (output truncated to last few lines...)

   _wrap_Display_ChangeMode(PyObject*, PyObject*, PyObject*)':
src/gtk/misc_wrap.cpp:27947: parse error before `)' token
src/gtk/misc_wrap.cpp: In function `PyObject*
   _wrap_Display_ResetMode(PyObject*, PyObject*, PyObject*)':
src/gtk/misc_wrap.cpp:27987: parse error before `)' token
error: command '/opt/sfw/gcc-3.2/bin/gcc' failed with exit status 1

Any suggesstions!?
Question by:Mike R.
  • 3
  • 2
LVL 38

Expert Comment

ID: 12295347
I think it is easy to just download the binary package from:

Now get back to your problem, it could be the problem with your gcc complier, or some
of the lib path (LD_LIBRARY_PATH) missing.

The last time I built python was 2 years+ ago. I used gcc2.95.x (I have trouble with gcc3.0.x
for building mysql/php etc).  I have not use gcc-3.2.x, don't know how good it is. I have used
gcc 3.3.2 to built a webserver early this year, not much trouble.

You might want to check the Makefile (created by configure) to make sure things are ok,
eg Link flags etc. I normaly use gcc + glib + libgcc +zlib + autoconfig (GNU), not sure
if you have all of them installed in your system.

LVL 38

Expert Comment

ID: 12295522
Hi rightmirem,

"SOLARIS NOTE: The --enable-rpath option may cause problems when using wxGTK on Solaris when compiling wxPython as described below. The woraround is to not use --enable-rpath flag for configure, but in that case all wxPython applications must have the LD_LIBRARY_PATH set to include $WXPREF/lib, or you can use the 'crle' program to modify the runtime linking environment. If this is the only installation of wxGTK on the system then you can use a system library path for prefix and not have to worry about it at all"

see :

Author Comment

by:Mike R.
ID: 12300095
Hey Yuzh,

Thanks again for all the help.  I actually tried configuring both with and without the enable-rpath (was thinking the same thing) and still ended up with the same errors.  I also tried the "disable-gtk2" flag just in case, but to no avail.

As an aside...I went to sunfreeware and was able to find the Pythin binary...but no the wxPython binaries.  I am wondering if I just looked in the wrong spot.  You don't happen to have the full link do you?  Or is the wx stuff included in the main Python install from that download?

I THINK all the pathiong and links are correct in the make file.  I am using gcc, g++, but I am not sure regarding the details of their installation as I inherited this system.

As far as adding items to the path...the configure is only identifying gtk1.2 as being on the system...and I am not sure if there is a difference between gtk1.2 and wxGtk.  What should I be looking for reagrding GTK installations (files with a find...for example?)

LVL 38

Accepted Solution

yuzh earned 2000 total points
ID: 12305357
wxGtk = wxWindows with GTK+, requires the GTK+ library to be installed on your system.

See "wxWindows 2.5 for GTK installation":


Author Comment

by:Mike R.
ID: 12309988
Hey Yuzh,

We do have GTK1.2.3 installed...but I discovered it was a different issue.

Simply put, the installation of wxPython runs TWO "makes".  First you run a standard configure, and a standard make/make install.  This compiles and creates all the necessary files and libs...just like every other install on the face of the (UNIX) earth.

HOWEVER...once the wxPython files are then have to run the "python3.2 install" command to install these files INTO the existing Python install.  Seems simple enough...

The PROBLEM was that...when compiling I was using the "--prefix=<wherever>" switch to try and install the libs into a preferred sub directory...which was a DIFFERENT sub-dir than where Python3.2 was installed.  The standard (first) configure/make worked fine...BUT when running the "" stuff, Python was attempting to "install" these files where IT wanted them (in its own lib) and the contradiction between where I told the config/make to install them, and where Python wanted to install them, was causing the error.

Once I set the "--prefix=<existing python install>" during the configuration and make, everything functioned fine.  So we are good to go.  You still get points for the efforts though :-)

And may i say I hope I never have to deal with Python again (well, at least for another couple of least :-)

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

606 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question