Build problem

Hi all,

I try to build wxPython.2.8.12 (2.8.10 does the same) on Mandriva 2011.0 :

···

--------------------------------------
python setup.py build_ext --inplace --debug UNICODE=0
...
g++ -pthread -shared -Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro -Wl,-O1 -Wl,--build-id -Wl,--enable-new-dtags -g build-gtk2/temp.linux-i686-2.7/src/helpers.o build-gtk2/temp.linux-i686-2.7/src/gtk/_core_wrap.o -L/usr/X11R6/lib -L/usr/lib -lwx_gtk2d_richtext-2.8 -lwx_gtk2d_aui-2.8 -lwx_gtk2d_xrc-2.8 -lwx_gtk2d_html-2.8 -lwx_gtk2d_adv-2.8 -lwx_gtk2d_core-2.8 -lwx_based_xml-2.8 -lwx_based_net-2.8 -lwx_based-2.8 -lpython2.7 -o /usr/local/wxPython-src-2.8.12.1/wxPython/wx/_core_.so -pthread
build-gtk2/temp.linux-i686-2.7/src/helpers.o: In function `wxPyGetWinHandle(wxWindow*)':
/usr/local/wxPython-src-2.8.12.1/wxPython/src/helpers.cpp:2113: undefined reference to `g_type_check_instance_cast'
/usr/local/wxPython-src-2.8.12.1/wxPython/src/helpers.cpp:2113: undefined reference to `gdk_x11_drawable_get_xid'
/usr/local/wxPython-src-2.8.12.1/wxPython/src/helpers.cpp:2113: undefined reference to `gdk_x11_drawable_get_xid'
build-gtk2/temp.linux-i686-2.7/src/helpers.o: In function `wxPyTestDisplayAvailable()':
/usr/local/wxPython-src-2.8.12.1/wxPython/src/helpers.cpp:3276: undefined reference to `XOpenDisplay'
/usr/local/wxPython-src-2.8.12.1/wxPython/src/helpers.cpp:3279: undefined reference to `XCloseDisplay'
collect2: ld a retourn� 1 code d'�tat d'ex�cution
error: command 'g++' failed with exit status 1
---------------------------------------

python :
Python 2.7.2 (default, Dec 19 2011, 09:56:13)
[GCC 4.6.1 20110627 (Mandriva)] on linux2
libgtk+2.0-devel-2.24.5-3-mdv2011.0.i586

It seems that the undefined references are in /usr/include/gtk-2.0/gdk/gdkx.h
Why the compiler does not find it ?
Is there a path problem ?

Hope somebody has any ideas.
Thanks, in advance.

Cheers.

--

Hugues JEAN-BAPTISTE (hjb@agorinfo.fr)
AGORINFO S.A.S. (http://www.agorinfo.fr)

Do you have the -devel packages installed for gtk2? (I'm not sure what Mandriva calls them...) If you have the headers I would assume that you do, but perhaps some parts were packaged separately.

What do you get when you run "pkg-config gtk+-2.0 --cflags"? Those flags should be visible in the compile commands that wxPython uses, but I don't see anything like "-I/usr/include/gtk-2.0" like I would expect to be there.

···

On 2/24/12 5:01 AM, Hugues JEAN-BAPTISTE wrote:

Hi all,

I try to build wxPython.2.8.12 (2.8.10 does the same) on Mandriva 2011.0 :

--------------------------------------
python setup.py build_ext --inplace --debug UNICODE=0
...
g++ -pthread -shared -Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro
-Wl,-O1 -Wl,--build-id -Wl,--enable-new-dtags -g
build-gtk2/temp.linux-i686-2.7/src/helpers.o
build-gtk2/temp.linux-i686-2.7/src/gtk/_core_wrap.o -L/usr/X11R6/lib
-L/usr/lib -lwx_gtk2d_richtext-2.8 -lwx_gtk2d_aui-2.8 -lwx_gtk2d_xrc-2.8
-lwx_gtk2d_html-2.8 -lwx_gtk2d_adv-2.8 -lwx_gtk2d_core-2.8
-lwx_based_xml-2.8 -lwx_based_net-2.8 -lwx_based-2.8 -lpython2.7 -o
/usr/local/wxPython-src-2.8.12.1/wxPython/wx/_core_.so -pthread
build-gtk2/temp.linux-i686-2.7/src/helpers.o: In function
`wxPyGetWinHandle(wxWindow*)':
/usr/local/wxPython-src-2.8.12.1/wxPython/src/helpers.cpp:2113:
undefined reference to `g_type_check_instance_cast'
/usr/local/wxPython-src-2.8.12.1/wxPython/src/helpers.cpp:2113:
undefined reference to `gdk_x11_drawable_get_xid'
/usr/local/wxPython-src-2.8.12.1/wxPython/src/helpers.cpp:2113:
undefined reference to `gdk_x11_drawable_get_xid'
build-gtk2/temp.linux-i686-2.7/src/helpers.o: In function
`wxPyTestDisplayAvailable()':
/usr/local/wxPython-src-2.8.12.1/wxPython/src/helpers.cpp:3276:
undefined reference to `XOpenDisplay'
/usr/local/wxPython-src-2.8.12.1/wxPython/src/helpers.cpp:3279:
undefined reference to `XCloseDisplay'
collect2: ld a retourn� 1 code d'�tat d'ex�cution
error: command 'g++' failed with exit status 1
---------------------------------------

python :
Python 2.7.2 (default, Dec 19 2011, 09:56:13)
[GCC 4.6.1 20110627 (Mandriva)] on linux2
libgtk+2.0-devel-2.24.5-3-mdv2011.0.i586

It seems that the undefined references are in
/usr/include/gtk-2.0/gdk/gdkx.h
Why the compiler does not find it ?
Is there a path problem ?

--
Robin Dunn
Software Craftsman

I installed version 2.8.10.1 with Mandriva Free 2010 from the
management application without problems. Here are the names of the
packages downloaded:

libwxPythonGTK2.8
wxPythonGTK2
wxPythonGTK-wxversion

···

On 24 feb, 16:01, Robin Dunn <ro...@alldunn.com> wrote:

On 2/24/12 5:01 AM, Hugues JEAN-BAPTISTE wrote:

> Hi all,

> I try to build wxPython.2.8.12 (2.8.10 does the same) on Mandriva 2011.0 :

> --------------------------------------
> python setup.py build_ext --inplace --debug UNICODE=0
> ...
> g++ -pthread -shared -Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro
> -Wl,-O1 -Wl,--build-id -Wl,--enable-new-dtags -g
> build-gtk2/temp.linux-i686-2.7/src/helpers.o
> build-gtk2/temp.linux-i686-2.7/src/gtk/_core_wrap.o -L/usr/X11R6/lib
> -L/usr/lib -lwx_gtk2d_richtext-2.8 -lwx_gtk2d_aui-2.8 -lwx_gtk2d_xrc-2.8
> -lwx_gtk2d_html-2.8 -lwx_gtk2d_adv-2.8 -lwx_gtk2d_core-2.8
> -lwx_based_xml-2.8 -lwx_based_net-2.8 -lwx_based-2.8 -lpython2.7 -o
> /usr/local/wxPython-src-2.8.12.1/wxPython/wx/_core_.so -pthread
> build-gtk2/temp.linux-i686-2.7/src/helpers.o: In function
> `wxPyGetWinHandle(wxWindow*)':
> /usr/local/wxPython-src-2.8.12.1/wxPython/src/helpers.cpp:2113:
> undefined reference to `g_type_check_instance_cast'
> /usr/local/wxPython-src-2.8.12.1/wxPython/src/helpers.cpp:2113:
> undefined reference to `gdk_x11_drawable_get_xid'
> /usr/local/wxPython-src-2.8.12.1/wxPython/src/helpers.cpp:2113:
> undefined reference to `gdk_x11_drawable_get_xid'
> build-gtk2/temp.linux-i686-2.7/src/helpers.o: In function
> `wxPyTestDisplayAvailable()':
> /usr/local/wxPython-src-2.8.12.1/wxPython/src/helpers.cpp:3276:
> undefined reference to `XOpenDisplay'
> /usr/local/wxPython-src-2.8.12.1/wxPython/src/helpers.cpp:3279:
> undefined reference to `XCloseDisplay'
> collect2: ld a retourn 1 code d' tat d'ex cution
> error: command 'g++' failed with exit status 1
> ---------------------------------------

> python :
> Python 2.7.2 (default, Dec 19 2011, 09:56:13)
> [GCC 4.6.1 20110627 (Mandriva)] on linux2
> libgtk+2.0-devel-2.24.5-3-mdv2011.0.i586

> It seems that the undefined references are in
> /usr/include/gtk-2.0/gdk/gdkx.h
> Why the compiler does not find it ?
> Is there a path problem ?

Do you have the -devel packages installed for gtk2? (I'm not sure what
Mandriva calls them...) If you have the headers I would assume that you
do, but perhaps some parts were packaged separately.

What do you get when you run "pkg-config gtk+-2.0 --cflags"? Those
flags should be visible in the compile commands that wxPython uses, but
I don't see anything like "-I/usr/include/gtk-2.0" like I would expect
to be there.

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

Thank you for your answer Alan.
I have no problem to compile too on Mandriva 2010.
The problem is for the moment, I can't use Unicode version of wxPython.
To much modifications in my programs, it's in my TODO list and my TODO list is too big.
So for a non unicode version, it's necessary I compile it.
There is also a pre-compiled unicode version of wxPython (rpm packages) in the Mandriva 2011.

I'll come back to the office on monday and I'll try : "pkg-config gtk+-2.0 --cflags" (As Doctor Robin said)

Hope, after, all my problems will fly away, as in a dream ...

Hugues JEAN-BAPTISTE (hjb@agorinfo.fr)
AGORINFO S.A.S. (http://www.agorinfo.fr)

Le 25/02/2012 12:24, Alan Etkin a �crit :

···

I installed version 2.8.10.1 with Mandriva Free 2010 from the
management application without problems. Here are the names of the
packages downloaded:

libwxPythonGTK2.8
wxPythonGTK2
wxPythonGTK-wxversion

On 24 feb, 16:01, Robin Dunn<ro...@alldunn.com> wrote:

On 2/24/12 5:01 AM, Hugues JEAN-BAPTISTE wrote:

Hi all,
I try to build wxPython.2.8.12 (2.8.10 does the same) on Mandriva 2011.0 :
--------------------------------------
python setup.py build_ext --inplace --debug UNICODE=0
...
g++ -pthread -shared -Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro
-Wl,-O1 -Wl,--build-id -Wl,--enable-new-dtags -g
build-gtk2/temp.linux-i686-2.7/src/helpers.o
build-gtk2/temp.linux-i686-2.7/src/gtk/_core_wrap.o -L/usr/X11R6/lib
-L/usr/lib -lwx_gtk2d_richtext-2.8 -lwx_gtk2d_aui-2.8 -lwx_gtk2d_xrc-2.8
-lwx_gtk2d_html-2.8 -lwx_gtk2d_adv-2.8 -lwx_gtk2d_core-2.8
-lwx_based_xml-2.8 -lwx_based_net-2.8 -lwx_based-2.8 -lpython2.7 -o
/usr/local/wxPython-src-2.8.12.1/wxPython/wx/_core_.so -pthread
build-gtk2/temp.linux-i686-2.7/src/helpers.o: In function
`wxPyGetWinHandle(wxWindow*)':
/usr/local/wxPython-src-2.8.12.1/wxPython/src/helpers.cpp:2113:
undefined reference to `g_type_check_instance_cast'
/usr/local/wxPython-src-2.8.12.1/wxPython/src/helpers.cpp:2113:
undefined reference to `gdk_x11_drawable_get_xid'
/usr/local/wxPython-src-2.8.12.1/wxPython/src/helpers.cpp:2113:
undefined reference to `gdk_x11_drawable_get_xid'
build-gtk2/temp.linux-i686-2.7/src/helpers.o: In function
`wxPyTestDisplayAvailable()':
/usr/local/wxPython-src-2.8.12.1/wxPython/src/helpers.cpp:3276:
undefined reference to `XOpenDisplay'
/usr/local/wxPython-src-2.8.12.1/wxPython/src/helpers.cpp:3279:
undefined reference to `XCloseDisplay'
collect2: ld a retourn 1 code d' tat d'ex cution
error: command 'g++' failed with exit status 1
---------------------------------------
python :
Python 2.7.2 (default, Dec 19 2011, 09:56:13)
[GCC 4.6.1 20110627 (Mandriva)] on linux2
libgtk+2.0-devel-2.24.5-3-mdv2011.0.i586
It seems that the undefined references are in
/usr/include/gtk-2.0/gdk/gdkx.h
Why the compiler does not find it ?
Is there a path problem ?

Do you have the -devel packages installed for gtk2? (I'm not sure what
Mandriva calls them...) If you have the headers I would assume that you
do, but perhaps some parts were packaged separately.

What do you get when you run "pkg-config gtk+-2.0 --cflags"? Those
flags should be visible in the compile commands that wxPython uses, but
I don't see anything like "-I/usr/include/gtk-2.0" like I would expect
to be there.

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

Le 24/02/2012 20:01, Robin Dunn a �crit :

Hi all,

I try to build wxPython.2.8.12 (2.8.10 does the same) on Mandriva 2011.0 :

--------------------------------------
python setup.py build_ext --inplace --debug UNICODE=0
...
g++ -pthread -shared -Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro
-Wl,-O1 -Wl,--build-id -Wl,--enable-new-dtags -g
build-gtk2/temp.linux-i686-2.7/src/helpers.o
build-gtk2/temp.linux-i686-2.7/src/gtk/_core_wrap.o -L/usr/X11R6/lib
-L/usr/lib -lwx_gtk2d_richtext-2.8 -lwx_gtk2d_aui-2.8 -lwx_gtk2d_xrc-2.8
-lwx_gtk2d_html-2.8 -lwx_gtk2d_adv-2.8 -lwx_gtk2d_core-2.8
-lwx_based_xml-2.8 -lwx_based_net-2.8 -lwx_based-2.8 -lpython2.7 -o
/usr/local/wxPython-src-2.8.12.1/wxPython/wx/_core_.so -pthread
build-gtk2/temp.linux-i686-2.7/src/helpers.o: In function
`wxPyGetWinHandle(wxWindow*)':
/usr/local/wxPython-src-2.8.12.1/wxPython/src/helpers.cpp:2113:
undefined reference to `g_type_check_instance_cast'
/usr/local/wxPython-src-2.8.12.1/wxPython/src/helpers.cpp:2113:
undefined reference to `gdk_x11_drawable_get_xid'
/usr/local/wxPython-src-2.8.12.1/wxPython/src/helpers.cpp:2113:
undefined reference to `gdk_x11_drawable_get_xid'
build-gtk2/temp.linux-i686-2.7/src/helpers.o: In function
`wxPyTestDisplayAvailable()':
/usr/local/wxPython-src-2.8.12.1/wxPython/src/helpers.cpp:3276:
undefined reference to `XOpenDisplay'
/usr/local/wxPython-src-2.8.12.1/wxPython/src/helpers.cpp:3279:
undefined reference to `XCloseDisplay'
collect2: ld a retourn� 1 code d'�tat d'ex�cution
error: command 'g++' failed with exit status 1
---------------------------------------

python :
Python 2.7.2 (default, Dec 19 2011, 09:56:13)
[GCC 4.6.1 20110627 (Mandriva)] on linux2
libgtk+2.0-devel-2.24.5-3-mdv2011.0.i586

It seems that the undefined references are in
/usr/include/gtk-2.0/gdk/gdkx.h
Why the compiler does not find it ?
Is there a path problem ?

Do you have the -devel packages installed for gtk2? (I'm not sure what Mandriva calls them...) If you have the headers I would assume that you do, but perhaps some parts were packaged separately.

What do you get when you run "pkg-config gtk+-2.0 --cflags"? Those flags should be visible in the compile commands that wxPython uses, but I don't see anything like "-I/usr/include/gtk-2.0" like I would expect to be there.

The result for "pkg-config gtk+-2.0 --cflags" is :

-pthread -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/gdk-pixbuf-2.0 -I/usr/include/pango-1.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/libpng12

If I compare the packages between Mandriva 2010.2 et Mandriva 2011.0, in a first look I don't see difference.
I have the package "libgtk+2.0-devel-2.24.5-3-mdv2011.0.i586" which contains /usr/include/gtk-2.0/gdk/gdkx.h.

So, "I give my tongue to the cat" (It's a French expression which means I don't know the answer and help is welcome).

Thank you again for your help

···

On 2/24/12 5:01 AM, Hugues JEAN-BAPTISTE wrote:

--

Hugues JEAN-BAPTISTE (hjb@agorinfo.fr)
AGORINFO S.A.S. (http://www.agorinfo.fr)

"Meow"

The output of the pkg-config command should be used in the compile command lines for the wxPython build, but I don't see those flags used above. So my guess is that there is something going wrong in the config.py or setup.py scripts when it is running that command, or that the use of the flags is being suppressed somehow. You should try debugging the setup.py script to see if you can figure out what is happening.

···

On 2/27/12 1:24 AM, Hugues JEAN-BAPTISTE wrote:

Le 24/02/2012 20:01, Robin Dunn a �crit :

On 2/24/12 5:01 AM, Hugues JEAN-BAPTISTE wrote:

Hi all,

I try to build wxPython.2.8.12 (2.8.10 does the same) on Mandriva
2011.0 :

--------------------------------------
python setup.py build_ext --inplace --debug UNICODE=0
...
g++ -pthread -shared -Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro
-Wl,-O1 -Wl,--build-id -Wl,--enable-new-dtags -g
build-gtk2/temp.linux-i686-2.7/src/helpers.o
build-gtk2/temp.linux-i686-2.7/src/gtk/_core_wrap.o -L/usr/X11R6/lib
-L/usr/lib -lwx_gtk2d_richtext-2.8 -lwx_gtk2d_aui-2.8 -lwx_gtk2d_xrc-2.8
-lwx_gtk2d_html-2.8 -lwx_gtk2d_adv-2.8 -lwx_gtk2d_core-2.8
-lwx_based_xml-2.8 -lwx_based_net-2.8 -lwx_based-2.8 -lpython2.7 -o
/usr/local/wxPython-src-2.8.12.1/wxPython/wx/_core_.so -pthread
build-gtk2/temp.linux-i686-2.7/src/helpers.o: In function
`wxPyGetWinHandle(wxWindow*)':
/usr/local/wxPython-src-2.8.12.1/wxPython/src/helpers.cpp:2113:
undefined reference to `g_type_check_instance_cast'
/usr/local/wxPython-src-2.8.12.1/wxPython/src/helpers.cpp:2113:
undefined reference to `gdk_x11_drawable_get_xid'
/usr/local/wxPython-src-2.8.12.1/wxPython/src/helpers.cpp:2113:
undefined reference to `gdk_x11_drawable_get_xid'
build-gtk2/temp.linux-i686-2.7/src/helpers.o: In function
`wxPyTestDisplayAvailable()':
/usr/local/wxPython-src-2.8.12.1/wxPython/src/helpers.cpp:3276:
undefined reference to `XOpenDisplay'
/usr/local/wxPython-src-2.8.12.1/wxPython/src/helpers.cpp:3279:
undefined reference to `XCloseDisplay'
collect2: ld a retourn� 1 code d'�tat d'ex�cution
error: command 'g++' failed with exit status 1
---------------------------------------

python :
Python 2.7.2 (default, Dec 19 2011, 09:56:13)
[GCC 4.6.1 20110627 (Mandriva)] on linux2
libgtk+2.0-devel-2.24.5-3-mdv2011.0.i586

It seems that the undefined references are in
/usr/include/gtk-2.0/gdk/gdkx.h
Why the compiler does not find it ?
Is there a path problem ?

Do you have the -devel packages installed for gtk2? (I'm not sure what
Mandriva calls them...) If you have the headers I would assume that
you do, but perhaps some parts were packaged separately.

What do you get when you run "pkg-config gtk+-2.0 --cflags"? Those
flags should be visible in the compile commands that wxPython uses,
but I don't see anything like "-I/usr/include/gtk-2.0" like I would
expect to be there.

The result for "pkg-config gtk+-2.0 --cflags" is :

-pthread -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/gdk-pixbuf-2.0 -I/usr/include/pango-1.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/libpng12

If I compare the packages between Mandriva 2010.2 et Mandriva 2011.0, in
a first look I don't see difference.
I have the package "libgtk+2.0-devel-2.24.5-3-mdv2011.0.i586" which
contains /usr/include/gtk-2.0/gdk/gdkx.h.

So, "I give my tongue to the cat" (It's a French expression which means
I don't know the answer and help is welcome).

Thank you again for your help

--
Robin Dunn
Software Craftsman

Le 27/02/2012 23:29, Robin Dunn a �crit :

Le 24/02/2012 20:01, Robin Dunn a �crit :

Hi all,

I try to build wxPython.2.8.12 (2.8.10 does the same) on Mandriva
2011.0 :

--------------------------------------
python setup.py build_ext --inplace --debug UNICODE=0
...
g++ -pthread -shared -Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro
-Wl,-O1 -Wl,--build-id -Wl,--enable-new-dtags -g
build-gtk2/temp.linux-i686-2.7/src/helpers.o
build-gtk2/temp.linux-i686-2.7/src/gtk/_core_wrap.o -L/usr/X11R6/lib
-L/usr/lib -lwx_gtk2d_richtext-2.8 -lwx_gtk2d_aui-2.8 -lwx_gtk2d_xrc-2.8
-lwx_gtk2d_html-2.8 -lwx_gtk2d_adv-2.8 -lwx_gtk2d_core-2.8
-lwx_based_xml-2.8 -lwx_based_net-2.8 -lwx_based-2.8 -lpython2.7 -o
/usr/local/wxPython-src-2.8.12.1/wxPython/wx/_core_.so -pthread
build-gtk2/temp.linux-i686-2.7/src/helpers.o: In function
`wxPyGetWinHandle(wxWindow*)':
/usr/local/wxPython-src-2.8.12.1/wxPython/src/helpers.cpp:2113:
undefined reference to `g_type_check_instance_cast'
/usr/local/wxPython-src-2.8.12.1/wxPython/src/helpers.cpp:2113:
undefined reference to `gdk_x11_drawable_get_xid'
/usr/local/wxPython-src-2.8.12.1/wxPython/src/helpers.cpp:2113:
undefined reference to `gdk_x11_drawable_get_xid'
build-gtk2/temp.linux-i686-2.7/src/helpers.o: In function
`wxPyTestDisplayAvailable()':
/usr/local/wxPython-src-2.8.12.1/wxPython/src/helpers.cpp:3276:
undefined reference to `XOpenDisplay'
/usr/local/wxPython-src-2.8.12.1/wxPython/src/helpers.cpp:3279:
undefined reference to `XCloseDisplay'
collect2: ld a retourn� 1 code d'�tat d'ex�cution
error: command 'g++' failed with exit status 1
---------------------------------------

python :
Python 2.7.2 (default, Dec 19 2011, 09:56:13)
[GCC 4.6.1 20110627 (Mandriva)] on linux2
libgtk+2.0-devel-2.24.5-3-mdv2011.0.i586

It seems that the undefined references are in
/usr/include/gtk-2.0/gdk/gdkx.h
Why the compiler does not find it ?
Is there a path problem ?

Do you have the -devel packages installed for gtk2? (I'm not sure what
Mandriva calls them...) If you have the headers I would assume that
you do, but perhaps some parts were packaged separately.

What do you get when you run "pkg-config gtk+-2.0 --cflags"? Those
flags should be visible in the compile commands that wxPython uses,
but I don't see anything like "-I/usr/include/gtk-2.0" like I would
expect to be there.

The result for "pkg-config gtk+-2.0 --cflags" is :

-pthread -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/gdk-pixbuf-2.0 -I/usr/include/pango-1.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/libpng12

If I compare the packages between Mandriva 2010.2 et Mandriva 2011.0, in
a first look I don't see difference.
I have the package "libgtk+2.0-devel-2.24.5-3-mdv2011.0.i586" which
contains /usr/include/gtk-2.0/gdk/gdkx.h.

So, "I give my tongue to the cat" (It's a French expression which means
I don't know the answer and help is welcome).

Thank you again for your help

"Meow"

The output of the pkg-config command should be used in the compile command lines for the wxPython build, but I don't see those flags used above. So my guess is that there is something going wrong in the config.py or setup.py scripts when it is running that command, or that the use of the flags is being suppressed somehow. You should try debugging the setup.py script to see if you can figure out what is happening.

Just before I can see the order :

gcc -pthread -fno-strict-aliasing -O2 -g -frecord-gcc-switches -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -fomit-frame-pointer -mtune=generic -march=i586 -fasynchronous-unwind-tables -DNDEBUG -O2 -g -frecord-gcc-switches -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -fomit-frame-pointer -mtune=generic -march=i586 -fasynchronous-unwind-tables -g -fPIC -g -DSWIG_TYPE_TABLE=_wxPython_table -DSWIG_PYTHON_OUTPUT_TUPLE -DWXP_USE_THREAD=1 -UNDEBUG -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXDEBUG__ -D__WXGTK__ -Iinclude -Isrc -I/usr/lib/wx/include/gtk2-ansi-debug-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/gdk-pixbuf-2.0 -I/usr/include/pango-1.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/libpng12 -I/usr/include/python2.7 -c src/helpers.cpp -o build-gtk2/temp.linux-i686-2.7/src/helpers.o -pthread -g -O0 -pthread

This part of the compilation works.

It seems that the problem comes from the option "-Wl,--no-undefined", given to g++ compiler. You can see it above in the mail.
In Mandriva 2010, there is not this option !...
If I try without this option, the compilation creates the file "_core_.so".
But the problem is not solved, I must confess, I am not a C programmer, don't repeat it :wink:

Is it normal, to have all these undefined references "XOpenDisplay", "XCloseDisplay", "g_type_check_instance_cast" and so on ... ?

1) Yes
I must find why this horrible compiler takes this bad option.
I have begun "man g++", but I am afraid to fall asleep only half ...
So help is welcome ...

2) No
I can try to comment all these bad lines in the sources, until the compilation works.
I hope it will stay a few lines in the programs

Thank you ...

···

On 2/27/12 1:24 AM, Hugues JEAN-BAPTISTE wrote:

On 2/24/12 5:01 AM, Hugues JEAN-BAPTISTE wrote:

--

Hugues JEAN-BAPTISTE (hjb@agorinfo.fr)
AGORINFO S.A.S. (http://www.agorinfo.fr)

Le 27/02/2012 23:29, Robin Dunn a �crit :

Le 24/02/2012 20:01, Robin Dunn a �crit :

Hi all,

I try to build wxPython.2.8.12 (2.8.10 does the same) on Mandriva
2011.0 :

--------------------------------------
python setup.py build_ext --inplace --debug UNICODE=0
...
g++ -pthread -shared -Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro
-Wl,-O1 -Wl,--build-id -Wl,--enable-new-dtags -g
build-gtk2/temp.linux-i686-2.7/src/helpers.o
build-gtk2/temp.linux-i686-2.7/src/gtk/_core_wrap.o -L/usr/X11R6/lib
-L/usr/lib -lwx_gtk2d_richtext-2.8 -lwx_gtk2d_aui-2.8
-lwx_gtk2d_xrc-2.8
-lwx_gtk2d_html-2.8 -lwx_gtk2d_adv-2.8 -lwx_gtk2d_core-2.8
-lwx_based_xml-2.8 -lwx_based_net-2.8 -lwx_based-2.8 -lpython2.7 -o
/usr/local/wxPython-src-2.8.12.1/wxPython/wx/_core_.so -pthread
build-gtk2/temp.linux-i686-2.7/src/helpers.o: In function
`wxPyGetWinHandle(wxWindow*)':
/usr/local/wxPython-src-2.8.12.1/wxPython/src/helpers.cpp:2113:
undefined reference to `g_type_check_instance_cast'
/usr/local/wxPython-src-2.8.12.1/wxPython/src/helpers.cpp:2113:
undefined reference to `gdk_x11_drawable_get_xid'
/usr/local/wxPython-src-2.8.12.1/wxPython/src/helpers.cpp:2113:
undefined reference to `gdk_x11_drawable_get_xid'
build-gtk2/temp.linux-i686-2.7/src/helpers.o: In function
`wxPyTestDisplayAvailable()':
/usr/local/wxPython-src-2.8.12.1/wxPython/src/helpers.cpp:3276:
undefined reference to `XOpenDisplay'
/usr/local/wxPython-src-2.8.12.1/wxPython/src/helpers.cpp:3279:
undefined reference to `XCloseDisplay'
collect2: ld a retourn� 1 code d'�tat d'ex�cution
error: command 'g++' failed with exit status 1
---------------------------------------

python :
Python 2.7.2 (default, Dec 19 2011, 09:56:13)
[GCC 4.6.1 20110627 (Mandriva)] on linux2
libgtk+2.0-devel-2.24.5-3-mdv2011.0.i586

It seems that the undefined references are in
/usr/include/gtk-2.0/gdk/gdkx.h
Why the compiler does not find it ?
Is there a path problem ?

Do you have the -devel packages installed for gtk2? (I'm not sure what
Mandriva calls them...) If you have the headers I would assume that
you do, but perhaps some parts were packaged separately.

What do you get when you run "pkg-config gtk+-2.0 --cflags"? Those
flags should be visible in the compile commands that wxPython uses,
but I don't see anything like "-I/usr/include/gtk-2.0" like I would
expect to be there.

The result for "pkg-config gtk+-2.0 --cflags" is :

-pthread -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/gdk-pixbuf-2.0 -I/usr/include/pango-1.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/libpng12

If I compare the packages between Mandriva 2010.2 et Mandriva 2011.0, in
a first look I don't see difference.
I have the package "libgtk+2.0-devel-2.24.5-3-mdv2011.0.i586" which
contains /usr/include/gtk-2.0/gdk/gdkx.h.

So, "I give my tongue to the cat" (It's a French expression which means
I don't know the answer and help is welcome).

Thank you again for your help

"Meow"

The output of the pkg-config command should be used in the compile
command lines for the wxPython build, but I don't see those flags used
above. So my guess is that there is something going wrong in the
config.py or setup.py scripts when it is running that command, or that
the use of the flags is being suppressed somehow. You should try
debugging the setup.py script to see if you can figure out what is
happening.

Just before I can see the order :

gcc -pthread -fno-strict-aliasing -O2 -g -frecord-gcc-switches
-Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security
-Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4
-fomit-frame-pointer -mtune=generic -march=i586
-fasynchronous-unwind-tables -DNDEBUG -O2 -g -frecord-gcc-switches
-Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security
-Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4
-fomit-frame-pointer -mtune=generic -march=i586
-fasynchronous-unwind-tables -g -fPIC -g
-DSWIG_TYPE_TABLE=_wxPython_table -DSWIG_PYTHON_OUTPUT_TUPLE
-DWXP_USE_THREAD=1 -UNDEBUG -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES
-D__WXDEBUG__ -D__WXGTK__ -Iinclude -Isrc
-I/usr/lib/wx/include/gtk2-ansi-debug-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/gdk-pixbuf-2.0
-I/usr/include/pango-1.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/libpng12
-I/usr/include/python2.7 -c src/helpers.cpp -o
build-gtk2/temp.linux-i686-2.7/src/helpers.o -pthread -g -O0 -pthread

This part of the compilation works.

Oops, sorry for leading you down the wrong path. I hadn't realized that it was the link step we were looking at before.

It seems that the problem comes from the option "-Wl,--no-undefined",
given to g++ compiler. You can see it above in the mail.
In Mandriva 2010, there is not this option !...

That just means to pass the --no-undefined option to the linker. Do "man ld" to see what it does. I'm not sure where that option comes from however as I don't see it in my build on Ubuntu. Perhaps it is there because of some customizations to how Python was built for Mandriva.

If I try without this option, the compilation creates the file "_core_.so".
But the problem is not solved, I must confess, I am not a C programmer,
don't repeat it :wink:

What happens in this case that makes you think it is not solved? Did you try rerunning setup.py so it can try building the rest of the modules?

Is it normal, to have all these undefined references "XOpenDisplay",
"XCloseDisplay", "g_type_check_instance_cast" and so on ... ?

No. However these symbols are in libraries that are not explicitly linked by the wxPython build, but they should be loaded implicitly due to the libraries that are linked by others. (wxGTK links with GTK libs which links with the X11 libs.)

1) Yes
I must find why this horrible compiler takes this bad option.
I have begun "man g++", but I am afraid to fall asleep only half ...
So help is welcome ...

2) No
I can try to comment all these bad lines in the sources, until the
compilation works.
I hope it will stay a few lines in the programs

If you want to go this way then there are two places you will need to change in helpers.cpp. In wxPyTestDisplayAvailable change the code inside of the "#ifdef __WXGTK__" to just "return true;" and in wxPyGetWinHandle change the code inside of "#if defined(__WXGTK__) || defined(__WXX11)" to "return 0;"

This will prevent you from being able to do anything that needs the handle of the underlying X-Window, like having some other X aware library (like dislin or vtk) draw upon your windows, but everything else should be okay.

···

On 2/29/12 7:25 AM, Hugues JEAN-BAPTISTE wrote:

On 2/27/12 1:24 AM, Hugues JEAN-BAPTISTE wrote:

On 2/24/12 5:01 AM, Hugues JEAN-BAPTISTE wrote:

--
Robin Dunn
Software Craftsman

Thank you a new time, Robin, for your help …

The build works perfectly with a modification of config.py :

`class MyUnixCCompiler(distutils.unixccompiler.UnixCCompiler):
      def _compile(self, obj, src, ext, cc_args, extra_postargs,

pp_opts):
compiler_so = self.compiler_so
if sys.platform == ‘darwin’:
compiler_so = _darwin_compiler_fixup(compiler_so,
cc_args + extra_postargs)
**# Mandriva 2011 -----------------------------------
self.linker_so = [el for el in self.linker_so
if el != ‘-Wl,–no-undefined’]
compiler_so = [el for el in compiler_so
if el != ‘-Werror=format-security’]
# Mandriva 2011 -----------------------------------
** try:

              self.spawn(compiler_so + cc_args + [src, '-o', obj] +

                         extra_postargs)

          except DistutilsExecError, msg:

              raise CompileError, msg

`

Tested with wxPython-src-2.8.10.1 and wxPython-src-2.8.12.1.
···

-- Hugues JEAN-BAPTISTE ()
AGORINFO S.A.S. ()

hjb@agorinfo.frhttp://www.agorinfo.fr

Just wanted to point out that this same modification is required for 2.9.x builds with both Mageia 2 & 3.

···

On Tuesday, March 6, 2012 9:47:40 AM UTC-7, Hugues JEAN-BAPTISTE wrote:

The build works perfectly with a modification of config.py :

`class MyUnixCCompiler(distutils.unixccompiler.UnixCCompiler):
      def _compile(self, obj, src, ext, cc_args, extra_postargs,

pp_opts):
compiler_so = self.compiler_so
if sys.platform == ‘darwin’:
compiler_so = _darwin_compiler_fixup( compiler_so,
cc_args + extra_postargs)
**# Mandriva 2011 -----------------------------------
self.linker_so = [el for el in self.linker_so
if el != ‘-Wl,–no-undefined’]
compiler_so = [el for el in compiler_so
if el != ‘-Werror=format-security’]
# Mandriva 2011 -----------------------------------
** try:

              self.spawn(compiler_so + cc_args + [src, '-o', obj] +

                         extra_postargs)

          except DistutilsExecError, msg:

              raise CompileError, msg

`

Tested with wxPython-src-2.8.10.1 and wxPython-src-2.8.12.1.