I know this has been covered in the past, but I'm having trouble building under wxPython 2.8.7.1 under Cygwin. I have followed the instructions on the wxPython site, but the src/helpers.cpp compile from the setup.py script fails because std::wstring is not defined. As near as I can tell, _GLIBCXX_USE_WCHAR_T or _GLIBCXX_USE_WSTRING must be defined to get wstring defined. Any ideas for getting around this will be greatly appreciated.
I have seen a post on the wxwidgets mailing list that -I /usr/include must be added to the compile, but I don't know how to do this in the wxPython infrastruture.
A buddy of mine pointed out that your instructions might be for compiling a wxPython that lives and in the Windows environment, not the Cygwin environment.
Yes, the directions on the web site assume python.org's Python and mingw32, see the bottom section of http://wxpython.org/builddoc.php. I don't think that it should take much work to make it work with cygwin's Python, the details just need to be worked out and tweaks made to setup.py.
In that case there would be no interaction with the Python that is installed in the Cygwin side, and the os.name would be "Windows_NT". I tried forcing the python command to the one on Windows and got other problems.
What problems?
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
The first failure was compiling stc_wrap.cpp, because wx/stc/stc.h couldn't be found. So I created an stc directory under /opt/wx/2.8/include/wx-2.8/wx, copied stc.h from contrib/src/stc to it. stc_wrap.cpp compiled successfully, but the ld step failed because the wx_mswd_stc-2.8 library couldn't be found. I copied it to /opt/wx/2.8/lib.
Next, I had similar problems with the gizmos directory. I copied all the header files from the gizmos directory to a new /opt/wx/2.8/include/wx-2.8/wx/gizmos directory. I also had to copy the dll.a for it to /opt/wx/2.8/lib.
Do you have a test suite I can run? I've run a couple of the demo.py demos, but haven't done an exhaustive check.
Harry
···
At 3:51 PM -0800 12/31/07, Robin Dunn wrote:
Harry Goldschmitt wrote:
At 10:28 AM -0800 12/27/07, Robin Dunn wrote:
Harry Goldschmitt wrote:
A buddy of mine pointed out that your instructions might be for compiling a wxPython that lives and in the Windows environment, not the Cygwin environment.
Yes, the directions on the web site assume python.org's Python and mingw32, see the bottom section of http://wxpython.org/builddoc.php. I don't think that it should take much work to make it work with cygwin's Python, the details just need to be worked out and tweaks made to setup.py.
In that case there would be no interaction with the Python that is installed in the Cygwin side, and the os.name would be "Windows_NT". I tried forcing the python command to the one on Windows and got other problems.
What problems?
I was trying to get wxwidgets and wxPython to compile under Cygwin. While trying to download the cairo source, I managed to totally mess up my Cygwin. While recovering from that, I reinstalled all of Cygwin, including the normally skipped packages and the cairo source. That took most of yesterday.
Next, if I let wxwidgets default to using GTK, I ran into a missing function gdk_cairo_create defined in header, gdkcairo.h, on my Linux box. I couldn't easily find a source package for GTK that installs on Cygwin. So I tried specifying several flavors of the configure options. This one worked:
I had to disable STL, due to the wstring problem, I previously ran into and I had to disable unicode for a similar problem. I had to turn off builtin regex, because it kept trying for a unicode build and couldn't find one. At any rate this worked for wxwidgets.h
Next I tried the setup.py. I forced WXPORT to msw in config.py. The result was:
$ python setup.py BUILD_GLCANVAS=0 BUILD_ACTIVEX=0 WX_CONFIG="bash.exe -e /opt/w
x/2.8/bin/wx-config" build_ext --inplace
WARNING: WXWIN not set in environment. Assuming '..'
Preparing CORE...
Preparing STC...
Preparing GIZMOS...
running build_ext
Warning: Can't read registry to find the necessary compiler setting
Make sure that Python modules _winreg, win32api or win32con are installed.
building '_core_' extension
error: Python was built with Visual Studio version 6, and extensions need to be
built with the same version of the compiler, but it isn't installed.
You need to tell distutils to use the gcc compiler instead of the MS compiler. Try adding --compiler=cygwin or --compiler=mingw32
The first failure was compiling stc_wrap.cpp, because wx/stc/stc.h couldn't be found. So I created an stc directory under /opt/wx/2.8/include/wx-2.8/wx, copied stc.h from contrib/src/stc to it. stc_wrap.cpp compiled successfully, but the ld step failed because the wx_mswd_stc-2.8 library couldn't be found. I copied it to /opt/wx/2.8/lib.
Next, I had similar problems with the gizmos directory. I copied all the header files from the gizmos directory to a new /opt/wx/2.8/include/wx-2.8/wx/gizmos directory. I also had to copy the dll.a for it to /opt/wx/2.8/lib.
You probably didn't do the make install step for the stc and gizmos libs.
Do you have a test suite I can run? I've run a couple of the demo.py demos, but haven't done an exhaustive check.
A test suite was recently added from a Google Summer of Code project, it's in the SVN repository.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!