Cannot build matplotlib-0.63.4 or cvs

       Hi, like other people in these list, I can't

    > compile matplotlib anymore with pygtk 2.4. I have the same
    > error than the others. I don't know C so I understand
    > nothing in these message. Someone was arriving to correct
    > this problem please?

The failure occurs at line 8 of src/_gtkagg.cpp; there is no
matplotlib code on line 8 or above, so I do not believe it is a
matplotlib problem. I think it is either a pygtk problem or a problem
with your environment (does your pkg-config point to the proper pygtk
install path?). Below is a c++ file that is identical to _gtkagg.cpp
up to the failing line, which is the gobject import. After that it
just prints hello world.

Try compiling it with (where the python include path should point to
Python.h)

  > g++ test.cpp `pkg-con-2.0` -I/usr/local/include/python2.3/

Are you using gcc-3.4? This seems to be a specific problem with
gcc-3.4 and pygtk-2.4. It would be helpful if you post your gcc
version, platform and pygtk version.

Please let me know if you learn anything else. If you fail to compile
the minimal example below, check your pygtk pkg-config paths and
consider posting this example to the pygtk mailing list; Niklas posted
and got no response, but he didn't have a minimal example which will
make a world of difference in people's ability to help.
Unfortunately, I don't have access to a machine with gcc-3.4 and the
latest pygtk to test with.

//test.cpp
#include <cstring>
#include <cerrno>
#include <cstdio>
#include <iostream>
#include <cmath>
#include <utility>

#include <pygobject.h>

int main() {
  std::cout << "hello gtk" << std::cout;
}

Hi John,

I'm using a debian linux with gcc 3.3.5, pygtk 2.4.0, precompiled

It's definitively a problem with pygtk2.4 because I have no problem to compile with 2.0 (from testing). Morever the problem comes only with the compilation. If I compile matplotlib with pygtk 2.2.0 I have no problem to use matplotlib even if I'm upgrading pygtk to 2.4.0. The problem seems to be in the header who comes from pygtk but I know nothing in these sort of file so I can't debug it.

Thanks,

    Nicolas

> gcc -v
Reading specs from /usr/lib/gcc-lib/i486-linux/3.3.5/specs
Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-debug --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc i486-linux
Thread model: posix
gcc version 3.3.5 (Debian 1:3.3.5-1)

gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include -I/usr/include -I/usr/include/pygtk-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/python2.3 -c test.cpp
In file included from /usr/include/python2.3/Python.h:8,
                 from /usr/include/pygtk-2.0/pygobject.h:5,
                 from test.cpp:8:
/usr/include/python2.3/pyconfig.h:856:1: warning: "_POSIX_C_SOURCE" redefined
In file included from /usr/include/string.h:26,
                 from /usr/include/c++/3.3/cstring:51,
                 from test.cpp:1:
/usr/include/features.h:131:1: warning: this is the location of the previous definition
In file included from test.cpp:8:
/usr/include/pygtk-2.0/pygobject.h:140: error: parse error before `typename'
/usr/include/pygtk-2.0/pygobject.h:147: error: parse error before `typename'

and when I put the pkg-config inside the line a obtain exactly the same thing.

gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include -I/usr/include -I/usr/include/pygtk-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/python2.3 `pkg-config-c test.cpp
`pkg-config
gruel@...364...:~/Matplotlib$ gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include -I/usr/include -I/usr/include/pygtk-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/python2.3 `pkg-config pygtk-2.0` -c test.cpp
In file included from /usr/include/python2.3/Python.h:8,
                 from /usr/include/pygtk-2.0/pygobject.h:5,
                 from test.cpp:8:
/usr/include/python2.3/pyconfig.h:856:1: warning: "_POSIX_C_SOURCE" redefined
In file included from /usr/include/string.h:26,
                 from /usr/include/c++/3.3/cstring:51,
                 from test.cpp:1:
/usr/include/features.h:131:1: warning: this is the location of the previous definition
In file included from test.cpp:8:
/usr/include/pygtk-2.0/pygobject.h:140: error: parse error before `typename'
/usr/include/pygtk-2.0/pygobject.h:147: error: parse error before `typename'