undefined symbol when import "wx"

Hi,

I have built wxPythonSrc-2.5.2.8, pretty much according to the instructions. After removing some of the optional stuff, etc., the build seems to be fine, with no errors.

When I try to run a python program, upon "import wx" I get the following error:

>>> import wx
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
   File "/usr/local/lib/python2.3/site-packages/wx/__init__.py", line 42, in ?
     from wx._core import *
   File "/usr/local/lib/python2.3/site-packages/wx/_core.py", line 4, in ?
     import _core_
ImportError: /usr/local/lib/libwx_gtk2_adv-2.5.so.2: undefined symbol: _ZTI21wxTaskBarIconAreaBase

This is on a Redhat 8.0 linux system.

I have run ldconfig, and have read postings in the list regarding undefined's, but really don't know what to do at this point.

Any ideas?

Thankyou very much for help.

David Geller
kelzar@sponsera.com

Hi,
I've been trying to get wxPython build to work, and found two problems:

1. wxTaskBarIconAreaBase class is defined in taskbar.cpp. However, most of the source in that file is conditionally compiled under
#if GTK_CHECK_VERSION(2, 1, 0)

My version of gtk (under rpm) is gtk2-2.0.6-8. So, this class never got defined, and somewhere else it is referenced. To "correct" this, I just wrote a class for wxTaskBarIconAreaBase with dummy methods which don't do anything.

2. I got compile error compiling splash.cpp. "GDK_WINDOW_TYPE_HINT_SPLASHSCREEN" is undefined. I commented out the call to "gtk_window_set_hint()", to get rid of this error.

I compiled and reinstalled wx libs, and then via "python setup.py build" and "python setup.py install", reinstalled the python libs.

I then tried to run "demo.py". It worked for awhile - initial splash screen came up; alas, then things died with

(demo.py:15251): Gtk-CRITICAL **: file gtkwidget.c: line 1876 (gtk_widget_realize): assertion `GTK_IS_WIDGET (widget)' failed
Segmentation fault

QUESTIONS:
1. what am I doing wrong?

2. How do I get a decent build of wxPython?

3. Do I/should I get a newer version of gtk2?

3. Are #1 and #2 legitimate bugs for my configuration, and should they be fixed in the distribution?

Any help would be deeply appreciated!

Regards,
David Geller

David Geller wrote:

···

Hi,

I have built wxPythonSrc-2.5.2.8, pretty much according to the instructions. After removing some of the optional stuff, etc., the build seems to be fine, with no errors.

When I try to run a python program, upon "import wx" I get the following error:

>>> import wx
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/local/lib/python2.3/site-packages/wx/__init__.py", line 42, in ?
    from wx._core import *
  File "/usr/local/lib/python2.3/site-packages/wx/_core.py", line 4, in ?
    import _core_
ImportError: /usr/local/lib/libwx_gtk2_adv-2.5.so.2: undefined symbol: _ZTI21wxTaskBarIconAreaBase

This is on a Redhat 8.0 linux system.

I have run ldconfig, and have read postings in the list regarding undefined's, but really don't know what to do at this point.

Any ideas?

Thankyou very much for help.

David Geller
kelzar@sponsera.com

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

David Geller wrote:

Hi,

I have built wxPythonSrc-2.5.2.8, pretty much according to the instructions. After removing some of the optional stuff, etc., the build seems to be fine, with no errors.

When I try to run a python program, upon "import wx" I get the following error:

>>> import wx
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/local/lib/python2.3/site-packages/wx/__init__.py", line 42, in ?
    from wx._core import *
  File "/usr/local/lib/python2.3/site-packages/wx/_core.py", line 4, in ?
    import _core_
ImportError: /usr/local/lib/libwx_gtk2_adv-2.5.so.2: undefined symbol: _ZTI21wxTaskBarIconAreaBase

This is on a Redhat 8.0 linux system.

I have run ldconfig, and have read postings in the list regarding undefined's, but really don't know what to do at this point.

IIRC there was a bug that could show up when an older GTK 2.x is used. Basically the wxTaskBarIcon class was disabled because some needed support was not present, but there were still some of the declarations compiled and without matching implementations you get the undefined symbol error.

Please try building the 2.5.3.1 release candidate instead, as I'm pretty sure I remember seeing a fix for this checked in.

http://starship.python.net/crew/robind/wxPython/preview/

···

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

David Geller wrote:

QUESTIONS:
1. what am I doing wrong?

2. How do I get a decent build of wxPython?

3. Do I/should I get a newer version of gtk2?

3. Are #1 and #2 legitimate bugs for my configuration, and should they be fixed in the distribution?

I think that they have been fixed in the current CVS code, and should be in 2.5.3.1 as I mention in my other mail on this thread.

···

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