[wx-dev] wxPython .so linking problem

Hi Steve,

[Hope I'm not outlasting my welcome here with all these questions.]

With Kevin's help, I got wxPython at least somewhhat successfully
built and installed. (Thanks again.) But now when I try to run
the program ("bitpim", bp.py) that's using wx, I get this error:

    Traceback (most recent call last):
      File "bp.py", line 75, in ?
        import gui
      File "/home/scs/projs/bitpim/bitpim/gui.py", line 28, in ?
        import wx
      File "/usr/lib/python2.3/site-packages/wx-2.6-gtk2-ansi/wx/__init__.py", line 42, in ?
        from wx._core import *
      File "/usr/lib/python2.3/site-packages/wx-2.6-gtk2-ansi/wx/_core.py", line 4, in ?
        import _core_
    ImportError: /usr/lib/python2.3/site-packages/wx-2.6-gtk2-ansi/wx/_core_.so: undefined symbol: __ti7wxEvent

Now, I can see that __ti7wxEvent is defined in one or two of the
new wx-related .so files in /usr/local/lib, but somehow the new
python modules aren't finding them. I tried running ldconfig,
and setting LD_LIBRARY_PATH, but neither seemed to help.
What mechanism is supposed to hook the modules in
/usr/lib/python2.3/site-packages up with the .so files in
/usr/local/lib?

LD_LIBRARY_PATH should do the trick, so I don't think the library isn't being found. My guess is that it's finding the library, but that at some point in your build the wxPython settings and the wxWidgets settings differed. This has happened to me before, and it was wxEvent symbols that were missing when I had the conflict. If you haven't already, try doing a completely clean build, either by unpacking or checking out a fresh source tree, or by cleaning all the build files out of the tree - i.e. do a make clean and a setup.py clean. (You may also need to remove the <wx root>/wxPython/build directory if it still exists.)

BTW, wxPython-dev is probably the best list for these discussions so I've copied this message over there. If you could reply there, that would be great. (I of course am on that list too. :wink:

Thanks,

Kevin

···

On Oct 31, 2005, at 8:52 PM, Steve Summit wrote:

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

Kevin Ollivier wrote:

If you haven't already, try doing a completely clean build, either by
unpacking or checking out a fresh source tree...

That was a good suggestion, and it worked! I got wxPython built
with many fewer problems than last night, and more importantly,
the main program I was trying to use that needed wxPython ("bitpim"),
which was the whole point of the exercise, is working too!

Besides retweaking defs.h as I described yesterday, the only thing
I had to do specially today was add BUILD_GLCANVAS=0 (which I've
now figured out how to do from the command line) when running
setup.py.

It would be interesting to figure out why I had so many problems
yesterday, and if I can, and if they suggest a way of improving
the build procedures, I'll let you know.

Thanks muchly, Kevin, for your help and your quick responses
last night.