Compilation error for wxPython

Dear All,

I am trying to compile wxPython-src-2.8.11.0 with Python 2.7 under
Ubuntu 10.04. wxWidgets itself compiles and installs fine with the
following configuration flags:

../configure --prefix=/export/apps/wx/2.8 --with-gtk --with-gnomeprint
--with-opengl --enable-unicode

wxPython is then compiled by calling
WX_CONFIG=/export/apps/wx/2.8/bin/wx-config python2.7 setup.py build,

resulting in the following errors:

···

------------------------------
building '_richtext' extension
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall
-Wstrict-prototypes -fPIC -DSWIG_TYPE_TABLE=_wxPython_table -
DSWIG_PYTHON_OUTPUT_TUPLE -DWXP_USE_THREAD=1 -UNDEBUG -
D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -D_REENTRANT -
Iinclude -Isrc -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/
include/wx-2.8 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/
usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/
usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/
include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/
include/directfb -I/usr/include/libpng12 -I/export/apps/python/2.7/
include/python2.7 -c src/gtk/richtext_wrap.cpp -o build-gtk2.unicode/
temp.linux-x86_64-2.7/src/gtk/richtext_wrap.o -pthread -O3 -pthread
cc1plus: warning: command line option "-Wstrict-prototypes" is valid
for Ada/C/ObjC but not for C++
src/gtk/richtext_wrap.cpp: In function \u2018void
SWIG_Python_AddErrorMsg(const char*)\u2019:
src/gtk/richtext_wrap.cpp:864: warning: format not a string literal
and no format arguments
In file included from src/gtk/richtext_wrap.cpp:2777:
include/wx/wxPython/wxPython.h: In function \u2018bool
wxPyCoreAPI_IMPORT()\u2019:
include/wx/wxPython/wxPython.h:39: warning: deprecated conversion from
string constant to \u2018char*\u2019
include/wx/wxPython/wxPython.h:39: warning: deprecated conversion from
string constant to \u2018char*\u2019
src/gtk/richtext_wrap.cpp: In function \u2018PyObject*
_wrap_RichTextCtrl_GetContextMenu(PyObject*, PyObject*)\u2019:
src/gtk/richtext_wrap.cpp:20096: error: \u2018const class
wxRichTextCtrl\u2019 has no member named \u2018GetContextMenu\u2019
src/gtk/richtext_wrap.cpp: In function \u2018PyObject*
_wrap_RichTextCtrl_SetContextMenu(PyObject*, PyObject*, PyObject*)
\u2019:
src/gtk/richtext_wrap.cpp:20136: error: \u2018class wxRichTextCtrl
\u2019 has no member named \u2018SetContextMenu\u2019
error: command 'gcc' failed with exit status 1
---------------------------------------
The configuration of the wxPython build seems fine since a config call
results in

---------------------------------------
WX_CONFIG=/export/apps/wx/2.8/bin/wx-config python2.7 setup.py config
WARNING: WXWIN not set in environment. Assuming '..'
Found wx-config: /usr/bin/wx-config
    Using flags: --toolkit=gtk2 --unicode=yes --version=2.8
Preparing CORE...
Preparing GLCANVAS...
Preparing STC...
Preparing GIZMOS...
running config
running config
---------------------------------------

Best wishes

Timo

Dear All,

I am trying to compile wxPython-src-2.8.11.0 with Python 2.7 under
Ubuntu 10.04. wxWidgets itself compiles and installs fine with the
following configuration flags:

../configure --prefix=/export/apps/wx/2.8 --with-gtk --with-gnomeprint
--with-opengl --enable-unicode

wxPython is then compiled by calling
WX_CONFIG=/export/apps/wx/2.8/bin/wx-config python2.7 setup.py build,

resulting in the following errors:

You need to put "WX_CONFIG=/export/apps/wx/2.8/bin/wx-config" at the *end* of the command line, not the beginning. We are wanting to pass a value to setup.py, not stick it in the environment.

The configuration of the wxPython build seems fine since a config call
results in

---------------------------------------
WX_CONFIG=/export/apps/wx/2.8/bin/wx-config python2.7 setup.py config
WARNING: WXWIN not set in environment. Assuming '..'
Found wx-config: /usr/bin/wx-config

This line is the main clue. It didn't see the WX_CONFIG setting so it searched the path and found one in /usr/bin.

···

On 9/5/10 2:03 PM, Timo wrote:

--
Robin Dunn
Software Craftsman

Dear Robin,

sorry for the late replay. I was away for two weeks.
Thanks a lot for the comment. I am now using

python2.7 setup.py build WX_CONFIG=/export/apps/wx/2.8/bin/wx-config

and the compilation goes much further. However, it still gets out with
an error message. The last lines of the compilation error message are:

contrib/stc/gtk/stc_wrap.cpp:24538: error: ‘wxEVT_STC_PAINTED’ was not
declared in this scope
contrib/stc/gtk/stc_wrap.cpp:24539: error:
‘wxEVT_STC_USERLISTSELECTION’ was not declared in this scope
contrib/stc/gtk/stc_wrap.cpp:24540: error: ‘wxEVT_STC_URIDROPPED’ was
not declared in this scope
contrib/stc/gtk/stc_wrap.cpp:24541: error: ‘wxEVT_STC_DWELLSTART’ was
not declared in this scope
contrib/stc/gtk/stc_wrap.cpp:24542: error: ‘wxEVT_STC_DWELLEND’ was
not declared in this scope
contrib/stc/gtk/stc_wrap.cpp:24543: error: ‘wxEVT_STC_START_DRAG’ was
not declared in this scope
contrib/stc/gtk/stc_wrap.cpp:24544: error: ‘wxEVT_STC_DRAG_OVER’ was
not declared in this scope
contrib/stc/gtk/stc_wrap.cpp:24545: error: ‘wxEVT_STC_DO_DROP’ was not
declared in this scope
contrib/stc/gtk/stc_wrap.cpp:24546: error: ‘wxEVT_STC_ZOOM’ was not
declared in this scope
contrib/stc/gtk/stc_wrap.cpp:24547: error: ‘wxEVT_STC_HOTSPOT_CLICK’
was not declared in this scope
contrib/stc/gtk/stc_wrap.cpp:24548: error: ‘wxEVT_STC_HOTSPOT_DCLICK’
was not declared in this scope
contrib/stc/gtk/stc_wrap.cpp:24549: error: ‘wxEVT_STC_CALLTIP_CLICK’
was not declared in this scope
contrib/stc/gtk/stc_wrap.cpp:24550: error:
‘wxEVT_STC_AUTOCOMP_SELECTION’ was not declared in this scope

How can I get around this?
Best wishes

Timo

···

On Sep 6, 11:39 pm, Robin Dunn <ro...@alldunn.com> wrote:

On 9/5/10 2:03 PM,Timowrote:

> Dear All,

> I am trying to compile wxPython-src-2.8.11.0 with Python 2.7 under
> Ubuntu 10.04. wxWidgets itself compiles and installs fine with the
> following configuration flags:

> ../configure --prefix=/export/apps/wx/2.8 --with-gtk --with-gnomeprint
> --with-opengl --enable-unicode

> wxPython is then compiled by calling
> WX_CONFIG=/export/apps/wx/2.8/bin/wx-config python2.7 setup.py build,

> resulting in the following errors:

You need to put "WX_CONFIG=/export/apps/wx/2.8/bin/wx-config" at the
*end* of the command line, not the beginning. We are wanting to pass a
value to setup.py, not stick it in the environment.

> The configuration of the wxPython build seems fine since a config call
> results in

> ---------------------------------------
> WX_CONFIG=/export/apps/wx/2.8/bin/wx-config python2.7 setup.py config
> WARNING: WXWIN not set in environment. Assuming '..'
> Found wx-config: /usr/bin/wx-config

This line is the main clue. It didn't see the WX_CONFIG setting so it
searched the path and found one in /usr/bin.

--
Robin Dunn
Software Craftsmanhttp://wxPython.org

Dear Robin,

sorry for the late replay. I was away for two weeks.
Thanks a lot for the comment. I am now using

python2.7 setup.py build WX_CONFIG=/export/apps/wx/2.8/bin/wx-config

and the compilation goes much further. However, it still gets out with
an error message. The last lines of the compilation error message are:

Were there any errors before these lines? Often in C/C++ the earlier errors are the important ones and those that come after do not tell you want the true problem is.

contrib/stc/gtk/stc_wrap.cpp:24538: error: �wxEVT_STC_PAINTED� was not
declared in this scope
contrib/stc/gtk/stc_wrap.cpp:24539: error:
�wxEVT_STC_USERLISTSELECTION� was not declared in this scope
contrib/stc/gtk/stc_wrap.cpp:24540: error: �wxEVT_STC_URIDROPPED� was
not declared in this scope
contrib/stc/gtk/stc_wrap.cpp:24541: error: �wxEVT_STC_DWELLSTART� was
not declared in this scope
contrib/stc/gtk/stc_wrap.cpp:24542: error: �wxEVT_STC_DWELLEND� was
not declared in this scope
contrib/stc/gtk/stc_wrap.cpp:24543: error: �wxEVT_STC_START_DRAG� was
not declared in this scope
contrib/stc/gtk/stc_wrap.cpp:24544: error: �wxEVT_STC_DRAG_OVER� was
not declared in this scope
contrib/stc/gtk/stc_wrap.cpp:24545: error: �wxEVT_STC_DO_DROP� was not
declared in this scope
contrib/stc/gtk/stc_wrap.cpp:24546: error: �wxEVT_STC_ZOOM� was not
declared in this scope
contrib/stc/gtk/stc_wrap.cpp:24547: error: �wxEVT_STC_HOTSPOT_CLICK�
was not declared in this scope
contrib/stc/gtk/stc_wrap.cpp:24548: error: �wxEVT_STC_HOTSPOT_DCLICK�
was not declared in this scope
contrib/stc/gtk/stc_wrap.cpp:24549: error: �wxEVT_STC_CALLTIP_CLICK�
was not declared in this scope
contrib/stc/gtk/stc_wrap.cpp:24550: error:
�wxEVT_STC_AUTOCOMP_SELECTION� was not declared in this scope

How can I get around this?

I'm guessing that you didn't build the stc lib. See step #2 at http://wxpython.org/builddoc.php

···

On 9/20/10 9:39 AM, Timo wrote:

--
Robin Dunn
Software Craftsman

Thanks, compiling the additional libraries did the trick. I overlooked
it in the wxPython installation guide.
Best wishes

Timo

···

On Sep 20, 7:12 pm, Robin Dunn <ro...@alldunn.com> wrote:

On 9/20/10 9:39 AM, Timo wrote:

> Dear Robin,

> sorry for the late replay. I was away for two weeks.
> Thanks a lot for the comment. I am now using

> python2.7 setup.py build WX_CONFIG=/export/apps/wx/2.8/bin/wx-config

> and the compilation goes much further. However, it still gets out with
> an error message. The last lines of the compilation error message are:

Were there any errors before these lines? Often in C/C++ the earlier
errors are the important ones and those that come after do not tell you
want the true problem is.

> contrib/stc/gtk/stc_wrap.cpp:24538: error: wxEVT_STC_PAINTED was not
> declared in this scope
> contrib/stc/gtk/stc_wrap.cpp:24539: error:
> wxEVT_STC_USERLISTSELECTION was not declared in this scope
> contrib/stc/gtk/stc_wrap.cpp:24540: error: wxEVT_STC_URIDROPPED was
> not declared in this scope
> contrib/stc/gtk/stc_wrap.cpp:24541: error: wxEVT_STC_DWELLSTART was
> not declared in this scope
> contrib/stc/gtk/stc_wrap.cpp:24542: error: wxEVT_STC_DWELLEND was
> not declared in this scope
> contrib/stc/gtk/stc_wrap.cpp:24543: error: wxEVT_STC_START_DRAG was
> not declared in this scope
> contrib/stc/gtk/stc_wrap.cpp:24544: error: wxEVT_STC_DRAG_OVER was
> not declared in this scope
> contrib/stc/gtk/stc_wrap.cpp:24545: error: wxEVT_STC_DO_DROP was not
> declared in this scope
> contrib/stc/gtk/stc_wrap.cpp:24546: error: wxEVT_STC_ZOOM was not
> declared in this scope
> contrib/stc/gtk/stc_wrap.cpp:24547: error: wxEVT_STC_HOTSPOT_CLICK
> was not declared in this scope
> contrib/stc/gtk/stc_wrap.cpp:24548: error: wxEVT_STC_HOTSPOT_DCLICK
> was not declared in this scope
> contrib/stc/gtk/stc_wrap.cpp:24549: error: wxEVT_STC_CALLTIP_CLICK
> was not declared in this scope
> contrib/stc/gtk/stc_wrap.cpp:24550: error:
> wxEVT_STC_AUTOCOMP_SELECTION was not declared in this scope

> How can I get around this?

I'm guessing that you didn't build the stc lib. See step #2 athttp://wxpython.org/builddoc.php

--
Robin Dunn
Software Craftsmanhttp://wxPython.org