wxPython on cygwin won't compile

Hi Guys,
I'm trying to install wxPython on my Vista's cygwin.
I followed the instructions of "Building on Windows with Cygwin/MingW32" on http://www.wxpython.org/BUILD.html, and managed to clear all obstacles up to and including section 3.
However, on section 4, I get:

$ python setup.py COMPILER=mingw32 BUILD_GLCANVAS=0 BUILD_ACTIVEX=0 WX_CONFIG="bash.exe -e /opt/wx/2.8/bin/wx-config" build_ext --inplace
WARNING: WXWIN not set in environment. Assuming '..'
Preparing CORE...
Preparing STC...
Preparing GIZMOS...
running build_ext
building '_core_' extension
gcc -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DSWIG_TYPE_TABLE=_wxPython_table -DSWIG_PYTHON_OUTPUT_TUPLE -DWXP_USE_THREAD=1 -UNDEBUG -D__WXDEBUG__ -DWXUSINGDLL -D__WXMSW__ -DXTHREADS -DXUSE_MTSAFE_API -Iinclude -Isrc -I/opt/wx/2.8/lib/wx/include/msw-unicode-debug-2.8 -I/opt/wx/2.8/include/wx-2.8 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/python2.5 -c src/helpers.cpp -o build-gtk2.unicode/temp.cygwin-1.5.25-i686-2.5/src/helpers.o -mthreads -O3
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
In file included from /opt/wx/2.8/include/wx-2.8/wx/memory.h:16,
                 from /opt/wx/2.8/include/wx-2.8/wx/object.h:20,
                 from /opt/wx/2.8/include/wx-2.8/wx/wx.h:16,
                 from include/wx/wxPython/wxPython_int.h:19,
                 from src/helpers.cpp:16:
/opt/wx/2.8/include/wx-2.8/wx/string.h:181: error: expected init-declarator before "wxStdString"
/opt/wx/2.8/include/wx-2.8/wx/string.h:181: error: expected `,' or `;' before "wxStdString"
/opt/wx/2.8/include/wx-2.8/wx/string.h:714: error: expected `,' or `...' before'&' token
/opt/wx/2.8/include/wx-2.8/wx/string.h:715: error: ISO C++ forbids declaration of `wxStdString' with no type
/opt/wx/2.8/include/wx-2.8/wx/string.h:715: error: `wxString::wxString(int)' and `wxString::wxString(int)' cannot be overloaded
/opt/wx/2.8/include/wx-2.8/wx/string.h: In constructor `wxString::wxString(int)':
/opt/wx/2.8/include/wx-2.8/wx/string.h:715: error: `s' undeclared (first use this function)
/opt/wx/2.8/include/wx-2.8/wx/string.h:715: error: (Each undeclared identifier is reported only once for each function it appears in.)
error: command 'gcc' failed with exit status 1

And I'm stumped.
Can anybody help ?

Thanks,
Ron.

Is there any reason why you aren't using the binaries for windows? I
am running the 2.8.9.1 binary for Python 2.6 on Vista and it runs
fine. Cygwin is very nice for a shell, however, I like to use
binaries wherever possible.

Nate Lowrie

···

On Sat, Dec 13, 2008 at 2:20 PM, Barak, Ron <Ron.Barak@lsi.com> wrote:

Hi Guys,
I'm trying to install wxPython on my Vista's cygwin.
I followed the instructions of "Building on Windows with Cygwin/MingW32" on Phoenix/README.rst at master · wxWidgets/Phoenix · GitHub, and managed to clear all obstacles up to and including section 3.
However, on section 4, I get:

$ python setup.py COMPILER=mingw32 BUILD_GLCANVAS=0 BUILD_ACTIVEX=0 WX_CONFIG="bash.exe -e /opt/wx/2.8/bin/wx-config" build_ext --inplace
WARNING: WXWIN not set in environment. Assuming '..'
Preparing CORE...
Preparing STC...
Preparing GIZMOS...
running build_ext
building '_core_' extension
gcc -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DSWIG_TYPE_TABLE=_wxPython_table -DSWIG_PYTHON_OUTPUT_TUPLE -DWXP_USE_THREAD=1 -UNDEBUG -D__WXDEBUG__ -DWXUSINGDLL -D__WXMSW__ -DXTHREADS -DXUSE_MTSAFE_API -Iinclude -Isrc -I/opt/wx/2.8/lib/wx/include/msw-unicode-debug-2.8 -I/opt/wx/2.8/include/wx-2.8 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/python2.5 -c src/helpers.cpp -o build-gtk2.unicode/temp.cygwin-1.5.25-i686-2.5/src/helpers.o -mthreads -O3
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
In file included from /opt/wx/2.8/include/wx-2.8/wx/memory.h:16,
                from /opt/wx/2.8/include/wx-2.8/wx/object.h:20,
                from /opt/wx/2.8/include/wx-2.8/wx/wx.h:16,
                from include/wx/wxPython/wxPython_int.h:19,
                from src/helpers.cpp:16:
/opt/wx/2.8/include/wx-2.8/wx/string.h:181: error: expected init-declarator before "wxStdString"
/opt/wx/2.8/include/wx-2.8/wx/string.h:181: error: expected `,' or `;' before "wxStdString"
/opt/wx/2.8/include/wx-2.8/wx/string.h:714: error: expected `,' or `...' before'&' token
/opt/wx/2.8/include/wx-2.8/wx/string.h:715: error: ISO C++ forbids declaration of `wxStdString' with no type
/opt/wx/2.8/include/wx-2.8/wx/string.h:715: error: `wxString::wxString(int)' and `wxString::wxString(int)' cannot be overloaded
/opt/wx/2.8/include/wx-2.8/wx/string.h: In constructor `wxString::wxString(int)':
/opt/wx/2.8/include/wx-2.8/wx/string.h:715: error: `s' undeclared (first use this function)
/opt/wx/2.8/include/wx-2.8/wx/string.h:715: error: (Each undeclared identifier is reported only once for each function it appears in.)
error: command 'gcc' failed with exit status 1

And I'm stumped.
Can anybody help ?

Thanks,
Ron.
_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Hi Mr. Lowrie,

The reasons are:

When I use the Windows Python inside cygwin, I cannot succeed in opening a Python shell:
when typing “python” at the bash prompt, the process just hangs there.

Another problem I’m having is that the windows python inside cygwin does not accept a *nix path, and forces me to use -

$ python /tmp/tmp.py
c:\Python25\python.exe: can’t open file ‘/tmp/tmp.py’: [Errno 2] No such file or directory

$ python cygpath -w /tmp/tmp.py
hello world!

$

So, I would rather use the native cygwin python with wxPython.

Bye,
Ron.

···

-----Original Message-----
From: Nate Lowrie [mailto:solodex2151@gmail.com]
Sent: Saturday, December 13, 2008 21:31
To: wxpython-users@lists.wxwidgets.org
Subject: Re: [wxpython-users] wxPython on cygwin won’t compile

Is there any reason why you aren’t using the binaries for windows? I am running the 2.8.9.1 binary for Python 2.6 on Vista and it runs fine. Cygwin is very nice for a shell, however, I like to use binaries wherever possible.

Nate Lowrie

On Sat, Dec 13, 2008 at 2:20 PM, Barak, Ron Ron.Barak@lsi.com wrote:

Hi Guys,
I’m trying to install wxPython on my Vista’s cygwin.
I followed the instructions of “Building on Windows with Cygwin/MingW32” on http://www.wxpython.org/BUILD.html, and managed to clear all obstacles up to and including section 3.
However, on section 4, I get:

$ python setup.py COMPILER=mingw32 BUILD_GLCANVAS=0 BUILD_ACTIVEX=0
WX_CONFIG=“bash.exe -e /opt/wx/2.8/bin/wx-config” build_ext --inplace
WARNING: WXWIN not set in environment. Assuming ‘…’
Preparing CORE…
Preparing STC…
Preparing GIZMOS…
running build_ext
building ‘core’ extension
gcc -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
-Wstrict-prototypes -DSWIG_TYPE_TABLE=wxPython_table
-DSWIG_PYTHON_OUTPUT_TUPLE -DWXP_USE_THREAD=1 -UNDEBUG -D__WXDEBUG
_
-DWXUSINGDLL -D__WXMSW__ -DXTHREADS -DXUSE_MTSAFE_API -Iinclude -Isrc
-I/opt/wx/2.8/lib/wx/include/msw-unicode-debug-2.8
-I/opt/wx/2.8/include/wx-2.8 -I/usr/include/gtk-2.0
-I/usr/lib/gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0
-I/usr/include/pango-1.0 -I/usr/include/freetype2
-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
-I/usr/include/python2.5 -c src/helpers.cpp -o
build-gtk2.unicode/temp.cygwin-1.5.25-i686-2.5/src/helpers.o -mthreads
-O3
cc1plus: warning: command line option “-Wstrict-prototypes” is valid
for Ada/C/ObjC but not for C++ In file included from /opt/wx/2.8/include/wx-2.8/wx/memory.h:16,
from /opt/wx/2.8/include/wx-2.8/wx/object.h:20,
from /opt/wx/2.8/include/wx-2.8/wx/wx.h:16,
from include/wx/wxPython/wxPython_int.h:19,
from src/helpers.cpp:16:
/opt/wx/2.8/include/wx-2.8/wx/string.h:181: error: expected init-declarator before “wxStdString”
/opt/wx/2.8/include/wx-2.8/wx/string.h:181: error: expected ,' or ;’ before “wxStdString”
/opt/wx/2.8/include/wx-2.8/wx/string.h:714: error: expected ,' or …’ before’&’ token
/opt/wx/2.8/include/wx-2.8/wx/string.h:715: error: ISO C++ forbids
declaration of wxStdString' with no type /opt/wx/2.8/include/wx-2.8/wx/string.h:715: error: wxString::wxString(int)’ and wxString::wxString(int)' cannot be overloaded /opt/wx/2.8/include/wx-2.8/wx/string.h: In constructor wxString::wxString(int)‘:
/opt/wx/2.8/include/wx-2.8/wx/string.h:715: error: `s’ undeclared
(first use this function)
/opt/wx/2.8/include/wx-2.8/wx/string.h:715: error: (Each undeclared
identifier is reported only once for each function it appears in.)
error: command ‘gcc’ failed with exit status 1

And I’m stumped.
Can anybody help ?

Thanks,
Ron.


wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

I am running Windows Python inside cygwin. Here are the steps I took
to get it installed and working inside cygwin.

Go to C:\cygwin\bin and delete the Python2.5.exe, Python.exe, and Pythonw.exe.
Install Python for Windows.
go to C:\etc\profile and change the following line:

PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:$PATH

To

PATH=/cygdrive/c/Python25:/cygdrive/c/Python25/Scripts:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:$PATH

*make sure to set it to your Python installation path...

fire up a cygwin shell prompt and type "python". Make sure that the
initial verbage is something like below:

Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit
(Intel)] on win32

You should be set now. If you have problems or questions, contact me
off list...

Regards,

Nate Lowrie

···

On Sun, Dec 14, 2008 at 3:34 AM, Barak, Ron <Ron.Barak@lsi.com> wrote:

When I use the Windows Python inside cygwin, I cannot succeed in opening a
Python shell:
when typing "python" at the bash prompt, the process just hangs there.

Barak, Ron wrote:

Hi Guys,
I'm trying to install wxPython on my Vista's cygwin.
I followed the instructions of "Building on Windows with Cygwin/MingW32" on Phoenix/README.rst at master · wxWidgets/Phoenix · GitHub, and managed to clear all obstacles up to and including section 3.
However, on section 4, I get:

$ python setup.py COMPILER=mingw32 BUILD_GLCANVAS=0 BUILD_ACTIVEX=0 WX_CONFIG="bash.exe -e /opt/wx/2.8/bin/wx-config" build_ext --inplace
WARNING: WXWIN not set in environment. Assuming '..'
Preparing CORE...
Preparing STC...
Preparing GIZMOS...
running build_ext
building '_core_' extension
gcc -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DSWIG_TYPE_TABLE=_wxPython_table -DSWIG_PYTHON_OUTPUT_TUPLE -DWXP_USE_THREAD=1 -UNDEBUG -D__WXDEBUG__ -DWXUSINGDLL -D__WXMSW__ -DXTHREADS -DXUSE_MTSAFE_API -Iinclude -Isrc -I/opt/wx/2.8/lib/wx/include/msw-unicode-debug-2.8 -I/opt/wx/2.8/include/wx-2.8 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/python2.5 -c src/helpers.cpp -o build-gtk2.unicode/temp.cygwin-1.5.25-i686-2.5/src/helpers.o -mthreads -O3
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
In file included from /opt/wx/2.8/include/wx-2.8/wx/memory.h:16,
                 from /opt/wx/2.8/include/wx-2.8/wx/object.h:20,
                 from /opt/wx/2.8/include/wx-2.8/wx/wx.h:16,
                 from include/wx/wxPython/wxPython_int.h:19,
                 from src/helpers.cpp:16:
/opt/wx/2.8/include/wx-2.8/wx/string.h:181: error: expected init-declarator before "wxStdString"
/opt/wx/2.8/include/wx-2.8/wx/string.h:181: error: expected `,' or `;' before "wxStdString"
/opt/wx/2.8/include/wx-2.8/wx/string.h:714: error: expected `,' or `...' before'&' token
/opt/wx/2.8/include/wx-2.8/wx/string.h:715: error: ISO C++ forbids declaration of `wxStdString' with no type
/opt/wx/2.8/include/wx-2.8/wx/string.h:715: error: `wxString::wxString(int)' and `wxString::wxString(int)' cannot be overloaded
/opt/wx/2.8/include/wx-2.8/wx/string.h: In constructor `wxString::wxString(int)':
/opt/wx/2.8/include/wx-2.8/wx/string.h:715: error: `s' undeclared (first use this function)
/opt/wx/2.8/include/wx-2.8/wx/string.h:715: error: (Each undeclared identifier is reported only once for each function it appears in.)
error: command 'gcc' failed with exit status 1

And I'm stumped.
Can anybody help ?

How did you configure wxWidgets? Did you happen to enable using stl or std_string? (It's possible that they are enabled by default for this compiler...) If so please disable and reconfigure/rebuild.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Barak, Ron wrote:

Hi Mr. Lowrie,

The reasons are:

When I use the Windows Python inside cygwin, I cannot succeed in opening a Python shell:
when typing "python" at the bash prompt, the process just hangs there.

If you're using the standard windows console app for the cygwin shell then running Python in unbuffered mode (with the -u command line arg) will take care of that. There are still similar problems if you use some other terminal app like rxvt or something.

Another problem I'm having is that the windows python inside cygwin does not accept a *nix path, and forces me to use -

I've written a little wrapper script that lets me get around this issue fairly well. It's not perfect, and it only changes the first non-option arg to a dos path, but it works for 95% of the things I need it for. I've attached the file. With this installed somewhere on the PATH and made executable I make and alias for running Python 2.5 with it something like this:

alias py25='wcmd $TOOLS/python25/python.exe'

wcmd (533 Bytes)

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!