Compiling issues wxPython-src-3.0.0.0

Hi folks,

First, I compile wxWidgets from above sources with following configure options:

–enable-unicode
–disable-debug_flag
–enable-shared
–disable-compat28
–disable-ribbon
–disable-mediactrl
–disable-aui
–disable-xrc
–disable-webkit
–disable-webview
–disable-gstreamer8
–disable-joystick
–disable-html
–disable-htmlhelp
–disable-gif
–disable-pcx
–disable-tga
–disable-iff
–disable-pnm
–disable-xpm
–disable-richtext
–without-opengl
–disable-stc
–disable-joystick
–disable-svg
–disable-protocols
–disable-sockets
–without-libtiff
–without-regex
–without-expat
–without-zlib
–without-libjpeg
–disable-sound

I know it is a very minimalistic wxWidgets but it does the job for me. Compiling and installing it to “/usr/local” works fine either.

Now, when trying to compile wxPython ( and referencing already installed wx-config ) with

python2.7 build-wxpython.py --no_config --no_wxbuild

it starts compiling and outputs:

WARNING: WXWIN not set in environment. Assuming ‘…’
Preparing CORE…
running build_ext
running build_ext
building ‘core’ extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DSWIG_TYPE_TABLE=wxPython_table -DSWIG_PYTHON_OUTPUT_TUPLE -DWXP_USE_THREAD=1 -D_FILE_OFFSET_BITS=64 -DwxDEBUG_LEVEL=0 -DWXUSINGDLL -D__WXGTK_ -Iinclude -Isrc -I/usr/local/lib/wx/include/gtk2-unicode-3.0 -I/usr/local/include/wx-3.0 -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/python2.7 -c src/helpers.cpp -o build/temp.linux-x86_64-2.7/src/helpers.o -pthread -O3 -pthread
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
In file included from include/wx/wxPython/wxPython_int.h:62:0,
from src/helpers.cpp:17:
/usr/local/include/wx-3.0/wx/htmllbox.h:35:68: error: expected class-name before ‘,’ token
/usr/local/include/wx-3.0/wx/htmllbox.h:37:1: error: expected class-name before ‘{’ token
/usr/local/include/wx-3.0/wx/htmllbox.h:118:48: error: ‘wxHtmlLinkInfo’ does not name a type
/usr/local/include/wx-3.0/wx/htmllbox.h:118:64: error: ISO C++ forbids declaration of ‘link’ with no type [-fpermissive]
/usr/local/include/wx-3.0/wx/htmllbox.h:135:42: error: ‘wxHtmlLinkInfo’ does not name a type
/usr/local/include/wx-3.0/wx/htmllbox.h:135:58: error: ISO C++ forbids declaration of ‘link’ with no type [-fpermissive]
/usr/local/include/wx-3.0/wx/htmllbox.h:136:13: error: ‘wxHtmlOpeningStatus’ does not name a type
/usr/local/include/wx-3.0/wx/htmllbox.h:146:36: error: ‘HTMLCursor’ has not been declared
src/helpers.cpp: In member function ‘void wxPyApp::_BootstrapApp()’:
src/helpers.cpp:559:51: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
src/helpers.cpp:568:57: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
src/helpers.cpp: In function ‘PyObject* __wxPySetDictionary(PyObject*, PyObject*)’:
src/helpers.cpp:791:71: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
src/helpers.cpp:796:65: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
src/helpers.cpp: In function ‘void wxPyOORClientData_dtor(wxPyOORClientData*)’:
src/helpers.cpp:947:72: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
src/helpers.cpp: In static member function ‘static wxPyCBInputStream* wxPyCBInputStream::create(PyObject*, bool)’:
src/helpers.cpp:1423:46: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
src/helpers.cpp:1424:46: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
src/helpers.cpp:1425:46: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
src/helpers.cpp: In static member function ‘static wxPyCBOutputStream* wxPyCBOutputStream::create(PyObject*, bool)’:
src/helpers.cpp:1616:48: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
src/helpers.cpp:1617:46: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
src/helpers.cpp:1618:46: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
src/helpers.cpp: In member function ‘void wxPyCallback::EventThunker(wxEvent&)’:
src/helpers.cpp:1822:63: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
src/helpers.cpp:1822:63: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
src/helpers.cpp: In function ‘bool wxColour_helper(PyObject*, wxColour**)’:
src/helpers.cpp:3070:88: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
error: command ‘gcc’ failed with exit status 1
ERROR: failed building wxPython.

Pretty much obvious that it must fail since it I did not compile wxWidgets with the HTML stuff.
Big Question is now why wxPython does not use my installed setup.h file to determine the components it has to exclude and simply leaves them out?
Maybe I missed some configuration options… Any hints are highly appreciated.

By the way: Starting to compile wxPython with Python3.2 fails due to syntax error in build-wxpython.py script. I think it is related to the newer Python version…

Anyway, thanks in advance!

Philipp

PR wrote:

Pretty much obvious that it must fail since it I did not compile
wxWidgets with the HTML stuff.
Big Question is now why wxPython does not use my installed setup.h file
to determine the components it has to exclude and simply leaves them out?
Maybe I missed some configuration options... Any hints are highly
appreciated.

Since most of the code in the wxPython wrappers is generated by a separate tool, and then compiled, it is not just a simple matter of #including setup.h and adding some #ifdef's. There wasn't an easy way (at least back at the beginning of the project) to get the definitions in setup.h into SWIG and use it to conditionally generate code, and there wasn't an easy way to add #ifdef's into the generated C++ code to do conditional compilation, so the remaining easy solution was to just assume that all of the wrapped classes are always available from the wxWidgets C++ lib.

There have been a few cases where I've pounded in a few conditional things such as wxMediaCtrl or wxGraphicsContext that might not be available because of missing 3rd party libraries, but in order to not break lots of other things I had to provide empty stub versions of the classes for the case where the real class is missing. That is a lot of extra work and maintenance burden, so it is only done in a few common cases.

By the way: Starting to compile wxPython with Python3.2 fails due to
syntax error in build-wxpython.py script. I think it is related to the
newer Python version...

Classic wxPython will only support up through Python 2.7. The wxPython in the new Phoenix project is supporting 2.7 and 3.3+

···

--
Robin Dunn
Software Craftsman

Hi Robin,

this is the answer I hoped not to hear :smiley:
Anyway, thanks for it!!

···

Am Freitag, 7. Februar 2014 22:09:42 UTC+1 schrieb Robin Dunn:

PR wrote:

Pretty much obvious that it must fail since it I did not compile

wxWidgets with the HTML stuff.

Big Question is now why wxPython does not use my installed setup.h file

to determine the components it has to exclude and simply leaves them out?

Maybe I missed some configuration options… Any hints are highly

appreciated.

Since most of the code in the wxPython wrappers is generated by a
separate tool, and then compiled, it is not just a simple matter of
#including setup.h and adding some #ifdef’s. There wasn’t an easy way
(at least back at the beginning of the project) to get the definitions
in setup.h into SWIG and use it to conditionally generate code, and
there wasn’t an easy way to add #ifdef’s into the generated C++ code to
do conditional compilation, so the remaining easy solution was to just
assume that all of the wrapped classes are always available from the
wxWidgets C++ lib.

There have been a few cases where I’ve pounded in a few conditional
things such as wxMediaCtrl or wxGraphicsContext that might not be
available because of missing 3rd party libraries, but in order to not
break lots of other things I had to provide empty stub versions of the
classes for the case where the real class is missing. That is a lot of
extra work and maintenance burden, so it is only done in a few common cases.

By the way: Starting to compile wxPython with Python3.2 fails due to

syntax error in build-wxpython.py script. I think it is related to the

newer Python version…

Classic wxPython will only support up through Python 2.7. The wxPython
in the new Phoenix project is supporting 2.7 and 3.3+


Robin Dunn

Software Craftsman

http://wxPython.org