Setup.py Problem with 2.5.1

Hey, I have installed the source for
gtk 2.4.1 (/usr), not to mention python from source (/usr/local).

I followed the instructions for building wxPython from source
(I grabebd the latest from cvs). I built with the options for GTK2,
and Unicode.

When running the setup.py, I get the following errors:
'''
WX_CONFIG not specified and wxgtkd-2.5-config not found on $PATH defaulting to "wx-config"
Preparing CORE...
Preparing GLCANVAS...
Preparing OGL...
Preparing STC...
Preparing XRC...
Preparing GIZMOS...
running build_ext
building '_core_' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -g -DSWIG_GLOBAL -DHAVE_CONFIG_H -DWXP_USE_THREAD=1 -UNDEBUG -D__WXDEBUG__ -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -Iinclude -Isrc -I/opt/wx/2.5/lib/wx/include/gtk2ud-2.5 -I/opt/wx/2.5/include -I/usr/include/gtk-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib/include -I/usr/X11R6/include -I/usr/local/include/python2.3 -c src/helpers.cpp -o build/temp.linux-i686-2.3/src/helpers.o -g -O0
In file included from /usr/include/glib-2.0/glib/galloca.h:30,
                 from /usr/include/glib-2.0/glib.h:30,
                 from /usr/include/gtk-2.0/gdk/gdktypes.h:32,
                 from /usr/include/gtk-2.0/gdk/gdkcolor.h:4,
                 from /usr/include/gtk-2.0/gdk/gdk.h:30,
                 from src/helpers.cpp:26:
/usr/include/glib-2.0/glib/gtypes.h:41: error: syntax error before `typedef'
In file included from /usr/include/glib-2.0/glib.h:31,
                 from /usr/include/gtk-2.0/gdk/gdktypes.h:32,
                 from /usr/include/gtk-2.0/gdk/gdkcolor.h:4,
                 from /usr/include/gtk-2.0/gdk/gdk.h:30,
                 from src/helpers.cpp:26:
/usr/include/glib-2.0/glib/garray.h:34: error: syntax error before `typedef'
/usr/include/glib-2.0/glib/garray.h:66: error: syntax error before `*' token
/usr/include/glib-2.0/glib/garray.h:69: error: syntax error before `*' token
/usr/include/glib-2.0/glib/garray.h:73: error: `GArray' was not declared in this scope
/usr/include/glib-2.0/glib/garray.h:73: error: `array' was not declared in this scope
/usr/include/glib-2.0/glib/garray.h:74: error: syntax error before `)' token
/usr/include/glib-2.0/glib/garray.h:75: error: syntax error before `*' token
/usr/include/glib-2.0/glib/garray.h:78: error: syntax error before `*' token
/usr/include/glib-2.0/glib/garray.h:81: error: syntax error before `*' token
/usr/include/glib-2.0/glib/garray.h:85: error: syntax error before `*' token
/usr/include/glib-2.0/glib/garray.h:87: error: syntax error before `*' token
/usr/include/glib-2.0/glib/garray.h:89: error: syntax error before `*' token
/usr/include/glib-2.0/glib/garray.h:91: error: syntax error before `*' token
/usr/include/glib-2.0/glib/garray.h:94: error: `GArray' was not declared in this scope
/usr/include/glib-2.0/glib/garray.h:94: error: `array' was not declared in this scope
/usr/include/glib-2.0/glib/garray.h:95: error: syntax error before `)' token
/usr/include/glib-2.0/glib/garray.h:96: error: `GArray' was not declared in this scope
/usr/include/glib-2.0/glib/garray.h:96: error: `array' was not declared in this scope
/usr/include/glib-2.0/glib/garray.h:97: error: syntax error before `,' token
In file included from /usr/include/glib-2.0/glib/gerror.h:24,
                 from /usr/include/glib-2.0/glib/gthread.h:30,
                 from /usr/include/glib-2.0/glib/gasyncqueue.h:30,
                 from /usr/include/glib-2.0/glib.h:32,
                 from /usr/include/gtk-2.0/gdk/gdktypes.h:32,
                 from /usr/include/gtk-2.0/gdk/gdkcolor.h:4,
                 from /usr/include/gtk-2.0/gdk/gdk.h:30,
                 from src/helpers.cpp:26:
/usr/include/glib-2.0/glib/gquark.h:34: error: syntax error before `typedef'
/usr/include/glib-2.0/glib/gquark.h:38: error: syntax error before `*' token
/usr/include/glib-2.0/glib/gquark.h:39: error: syntax error before `*' token
/usr/include/glib-2.0/glib/gquark.h:40: error: syntax error before `*' token
/usr/include/glib-2.0/glib/gquark.h:41: error: syntax error before `*' token
In file included from /usr/include/glib-2.0/glib/gthread.h:30,
                 from /usr/include/glib-2.0/glib/gasyncqueue.h:30,
                 from /usr/include/glib-2.0/glib.h:32,
                 from /usr/include/gtk-2.0/gdk/gdktypes.h:32,
                 from /usr/include/gtk-2.0/gdk/gdkcolor.h:4,
                 from /usr/include/gtk-2.0/gdk/gdk.h:30,
                 from src/helpers.cpp:26:
/usr/include/glib-2.0/glib/gerror.h:28: error: syntax error before `typedef'
/usr/include/glib-2.0/glib/gerror.h:32: error: 'GQuark' is used as a type, but is not defined as a type.
/usr/include/glib-2.0/glib/gerror.h:37: error: syntax error before `*' token
/usr/include/glib-2.0/glib/gerror.h:42: error: syntax error before `*' token
/usr/include/glib-2.0/glib/gerror.h:46: error: `GError' was not declared in this scope
/usr/include/glib-2.0/glib/gerror.h:46: error: `error' was not declared in this scope
/usr/include/glib-2.0/glib/gerror.h:46: error: variable or field `g_error_free' declared void
/usr/include/glib-2.0/glib/gerror.h:47: error: syntax error before `*' token
/usr/include/glib-2.0/glib/gerror.h:49: error: syntax error before `*' token
/usr/include/glib-2.0/glib/gerror.h:56: error: `GError' was not declared in this scope
/usr/include/glib-2.0/glib/gerror.h:56: error: `err' was not declared in this scope
/usr/include/glib-2.0/glib/gerror.h:57: error: `GQuark' was not declared in this scope
/usr/include/glib-2.0/glib/gerror.h:57: error: syntax error before `,' token
/usr/include/glib-2.0/glib/gerror.h: In function `void g_set_error(...)':
/usr/include/glib-2.0/glib/gerror.h:60: error: ISO C++ forbids declaration of `G_GNUC_PRINTF' with no type
/usr/include/glib-2.0/glib/gerror.h:60: error: initializer list being treated as compound expression
/usr/include/glib-2.0/glib/gerror.h:64: error: `GError' undeclared (first use this function)
/usr/include/glib-2.0/glib/gerror.h:64: error: (Each undeclared identifier is reported only once for each function it appears in.)
/usr/include/glib-2.0/glib/gerror.h:64: error: `dest' undeclared (first use this function)
/usr/include/glib-2.0/glib/gerror.h:65: error: `src' undeclared (first use this function)
/usr/include/glib-2.0/glib/gerror.h:65: error: variable or field `g_propagate_error' declared void
/usr/include/glib-2.0/glib/gerror.h:65: error: initializer list being treated as compound expression
/usr/include/glib-2.0/glib/gerror.h:68: error: `err' undeclared (first use this function)
/usr/include/glib-2.0/glib/gerror.h:68: error: variable or field `g_clear_error' declared void
In file included from /usr/include/glib-2.0/glib/gthread.h:32,
                 from /usr/include/glib-2.0/glib/gasyncqueue.h:30,
                 from /usr/include/glib-2.0/glib.h:32,
                 from /usr/include/gtk-2.0/gdk/gdktypes.h:32,
                 from /usr/include/gtk-2.0/gdk/gdkcolor.h:4,
                 from /usr/include/gtk-2.0/gdk/gdk.h:30,
                 from src/helpers.cpp:26:
/usr/include/glib-2.0/glib/gatomic.h:37: error: syntax error before `g_atomic_int_exchange_and_add'
In file included from /usr/include/glib-2.0/glib/gasyncqueue.h:30,
                 from /usr/include/glib-2.0/glib.h:32,
                 from /usr/include/gtk-2.0/gdk/gdktypes.h:32,
                 from /usr/include/gtk-2.0/gdk/gdkcolor.h:4,
                 from /usr/include/gtk-2.0/gdk/gdk.h:30,
                 from src/helpers.cpp:26:
/usr/include/glib-2.0/glib/gthread.h:39: error: syntax error before `GQuark'
/usr/include/glib-2.0/glib/gthread.h:59: error: declaration of `struct _GThread' in `void g_set_error(...)' which does not enclose `::'
/usr/include/glib-2.0/glib/gthread.h:59: confused by earlier errors, bailing out
error: command 'gcc' failed with exit status 1
'''

Now, I have even edited the path so /opt/wx/2.5/bin is included.
So what's the deal?

I am running on Mandrake 9.2

When I tried installing libgtk1.2_devel,
I get:
'''
de/glib-1.2 -I/usr/lib/glib/include -I/usr/X11R6/include -I/usr/local/include/python2.3 -c src/helpers.cpp -o build/temp.linux-i686-2.3/src/helpers.o -g -O0
In file included from /usr/include/gtk-1.2/gdk/gdk.h:31,
                 from src/helpers.cpp:26:
/usr/include/gtk-1.2/gdk/gdktypes.h:52: error: conflicting types for `typedef gulong GdkAtom'
/opt/wx/2.5/include/wx/defs.h:2317: error: previous declaration as `typedef struct _GdkAtom*GdkAtom'
/usr/include/gtk-1.2/gdk/gdktypes.h:57: error: conflicting types for `typedef struct _GdkWindow GdkWindow'
/opt/wx/2.5/include/wx/defs.h:2318: error: previous declaration as `typedef struct _GdkDrawable GdkWindow'
/usr/include/gtk-1.2/gdk/gdktypes.h:58: error: conflicting types for `typedef struct _GdkWindow GdkPixmap'
/opt/wx/2.5/include/wx/defs.h:2320: error: previous declaration as `typedef struct _GdkDrawable GdkPixmap'
/usr/include/gtk-1.2/gdk/gdktypes.h:59: error: conflicting types for `typedef struct _GdkWindow GdkBitmap'
/opt/wx/2.5/include/wx/defs.h:2319: error: previous declaration as `typedef struct _GdkDrawable GdkBitmap'
error: command 'gcc' failed with exit status 1
'''
Without libgtk1.2_devel, I have to copy the 1.2 gtk-config, edit it so it references 2.4, and use that
with 2.4.1, or else I get errors complaining about no gtk-config!

Can anyone help?

If not, when will the next binary release of wxPythonGTK2 be out?

Best,
Dan

Daniel Pozmanter wrote:

Hey, I have installed the source for
gtk 2.4.1 (/usr), not to mention python from source (/usr/local).

I followed the instructions for building wxPython from source
(I grabebd the latest from cvs). I built with the options for GTK2,
and Unicode.

When running the setup.py, I get the following errors:
'''
WX_CONFIG not specified and wxgtkd-2.5-config not found on $PATH defaulting to "wx-config"
Preparing CORE...
Preparing GLCANVAS...
Preparing OGL...
Preparing STC...
Preparing XRC...
Preparing GIZMOS...
running build_ext
building '_core_' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -g -DSWIG_GLOBAL -DHAVE_CONFIG_H -DWXP_USE_THREAD=1 -UNDEBUG -D__WXDEBUG__ -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -Iinclude -Isrc -I/opt/wx/2.5/lib/wx/include/gtk2ud-2.5 -I/opt/wx/2.5/include -I/usr/include/gtk-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib/include -I/usr/X11R6/include -I/usr/local/include/python2.3 -c src/helpers.cpp -o build/temp.linux-i686-2.3/src/helpers.o -g -O0
In file included from /usr/include/glib-2.0/glib/galloca.h:30,
                from /usr/include/glib-2.0/glib.h:30,
                from /usr/include/gtk-2.0/gdk/gdktypes.h:32,
                from /usr/include/gtk-2.0/gdk/gdkcolor.h:4,
                from /usr/include/gtk-2.0/gdk/gdk.h:30,
                from src/helpers.cpp:26:
/usr/include/glib-2.0/glib/gtypes.h:41: error: syntax error before `typedef'
In file included from /usr/include/glib-2.0/glib.h:31,
                from /usr/include/gtk-2.0/gdk/gdktypes.h:32,
                from /usr/include/gtk-2.0/gdk/gdkcolor.h:4,
                from /usr/include/gtk-2.0/gdk/gdk.h:30,
                from src/helpers.cpp:26:
/usr/include/glib-2.0/glib/garray.h:34: error: syntax error before `typedef'
/usr/include/glib-2.0/glib/garray.h:66: error: syntax error before `*' token
/usr/include/glib-2.0/glib/garray.h:69: error: syntax error before `*' token
/usr/include/glib-2.0/glib/garray.h:73: error: `GArray' was not declared in this scope

...

I don't have gtk 2.4 installed to figure this out, but my guess is that something has changed in their headers and so the order they are included in helpers.cpp is no longer correct, or something else needs to be included first, or something similar.

When I tried installing libgtk1.2_devel,
I get:

Did you also rebuild wxGTK to not use GTK2?

Without libgtk1.2_devel, I have to copy the 1.2 gtk-config, edit it so it references 2.4, and use that
with 2.4.1, or else I get errors complaining about no gtk-config!

You can't use gtk-config to build with gtk2, it was a 1.x only thing. They've switched to pkgconfig for gtk2.

Can anyone help?

If not, when will the next binary release of wxPythonGTK2 be out?

Maybe in a few weeks depending on how fast I get through my ToDo list.

···

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