wxPython not working properly

I posted earlier today but decided to repost with more information.

I downloaded wxPython-src-2.8.10.1 without issue and was able to build
and install wxWidgets on my Solaris 10 x86 machine without issue.
After the build/install I executed the sample/minimal application to
test, it works perfectly.

I then moved on to building wxPython:
1. I modified by PATH to include /opt/wx/2.8/bin
2. I set LD_LIBRARY_PATH to /opt/wx/2.8/lib
3. I modified config.py by uncommenting the lines below the "Solaris"
section.
4. When I attempted to build I received an error message regarding
CreateBitmap missing from wxGraphicsRenderer in _gdi_wrap.cpp. After
Googling around I copied the section from wxGraphicsContext into
wxGraphicsRenderer. I'm not sure how anyone could have built without
making this change.
5. I then built as "python2.5 setup.py build_ext --inplace --include-
dirs="/usr/X11R6/include" --force, the build succeeded (with many
warnings).
6. To test the wxPython I created PYTHONPATH as $WXDIR/wxPython,
execute python2.5, and attempt "import wx".

I receive the following error message:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/export/home/apollo/wxPython/wxPython-src-2.8.10.1/wxPython/wx/
__init__.py", line 45, in <module>
    from wx._core import *
  File "/export/home/apollo/wxPython/wxPython-src-2.8.10.1/wxPython/wx/
_core.py", line 4, in <module>
    import _core_
ImportError: ld.so.1: python2.5: fatal: relocation error: file /export/
home/apollo/wxPython/wxPython-src-2.8.10.1/wxPython/wx/_core_.so:
symbol _ZN5wxApp10InitializeERiPPw: referenced symbol not found

When I run ldd on the _core_.so file I receive:
# ldd $PYTHONPATH/wx/_core_.so
        libwx_gtk2ud_richtext-2.8.so.0.6.0 => /opt/wx/2.8/lib/
libwx_gtk2ud_richtext-2.8.so.0.6.0
        libwx_gtk2ud_aui-2.8.so.0.6.0 => /opt/wx/2.8/lib/
libwx_gtk2ud_aui-2.8.so.0.6.0
        libwx_gtk2ud_xrc-2.8.so.0.6.0 => /opt/wx/2.8/lib/
libwx_gtk2ud_xrc-2.8.so.0.6.0
        libwx_gtk2ud_qa-2.8.so.0.6.0 => /opt/wx/2.8/lib/
libwx_gtk2ud_qa-2.8.so.0.6.0
        libwx_gtk2ud_html-2.8.so.0.6.0 => /opt/wx/2.8/lib/
libwx_gtk2ud_html-2.8.so.0.6.0
        libwx_gtk2ud_adv-2.8.so.0.6.0 => /opt/wx/2.8/lib/
libwx_gtk2ud_adv-2.8.so.0.6.0
        libwx_gtk2ud_core-2.8.so.0.6.0 => /opt/wx/2.8/lib/
libwx_gtk2ud_core-2.8.so.0.6.0
        libwx_baseud_xml-2.8.so.0.6.0 => /opt/wx/2.8/lib/
libwx_baseud_xml-2.8.so.0.6.0
        libwx_baseud_net-2.8.so.0.6.0 => /opt/wx/2.8/lib/
libwx_baseud_net-2.8.so.0.6.0
        libwx_baseud-2.8.so.0.6.0 => /opt/wx/2.8/lib/
libwx_baseud-2.8.so.0.6.0
        libstdc++.so.6 => /usr/sfw/lib/libstdc++.so.6
        libm.so.2 => /lib/libm.so.2
        libgcc_s.so.1 => /usr/sfw/lib/libgcc_s.so.1
        libgtk-x11-2.0.so.0 => /usr/lib/libgtk-x11-2.0.so.0
        libgdk-x11-2.0.so.0 => /usr/lib/libgdk-x11-2.0.so.0
        libatk-1.0.so.0 => /usr/lib/libatk-1.0.so.0
        libgdk_pixbuf-2.0.so.0 => /usr/lib/libgdk_pixbuf-2.0.so.
0
        libmlib.so.2 => /usr/lib/libmlib.so.2
        libpangoxft-1.0.so.0 => /usr/lib/libpangoxft-1.0.so.0
        libpangox-1.0.so.0 => /usr/lib/libpangox-1.0.so.0
        libpango-1.0.so.0 => /usr/lib/libpango-1.0.so.0
        libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0
        libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0
        libgthread-2.0.so.0 => /usr/lib/libgthread-2.0.so.0
        libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0
        libXinerama.so.1 => /usr/lib/libXinerama.so.1
        libSM.so.6 => /usr/lib/libSM.so.6
        libpng12.so.0 => /usr/lib/libpng12.so.0
        libz.so.1 => /usr/lib/libz.so.1
        libjpeg.so.62 => /usr/lib/libjpeg.so.62
        libtiff.so.3 => /usr/lib/libtiff.so.3
        librt.so.1 => /lib/librt.so.1
        libnsl.so.1 => /lib/libnsl.so.1
        libsocket.so.1 => /lib/libsocket.so.1
        libexpat.so.1 => /usr/sfw/lib/libexpat.so.1
        libc.so.1 => /lib/libc.so.1
        libXft.so.2 => /usr/openwin/lib/libXft.so.2
        libfreetype.so.6 => /usr/sfw/lib/libfreetype.so.6
        libXrender.so.1 => /usr/sfw/lib/libXrender.so.1
        libfontconfig.so.1 => /usr/lib/libfontconfig.so.1
        libX11.so.4 => /usr/openwin/lib/libX11.so.4
        libXrandr.so.2 => /usr/X11/lib/libXrandr.so.2
        libXi.so.5 => /usr/openwin/lib/libXi.so.5
        libXext.so.0 => /usr/openwin/lib/libXext.so.0
        libpangoft2-1.0.so.0 => /usr/lib/libpangoft2-1.0.so.0
        libICE.so.6 => /usr/openwin/lib/libICE.so.6
        libaio.so.1 => /lib/libaio.so.1
        libmd.so.1 => /lib/libmd.so.1
        libmp.so.2 => /lib/libmp.so.2
        libscf.so.1 => /lib/libscf.so.1
        libdl.so.1 => /lib/libdl.so.1
        libdoor.so.1 => /lib/libdoor.so.1
        libuutil.so.1 => /lib/libuutil.so.1
        libgen.so.1 => /lib/libgen.so.1
        /usr/lib/libmlib/libmlib_sse2.so.2

The output from nm is:
# /usr/ccs/bin/nm /opt/wx/2.8/lib/libwx_gtk2ud_core-2.8.so.0.6.0 |
grep Initialize
[42000] | 2211148| 313|FUNC |GLOB |0 |956 |
_Z22wxInitializeStockListsv
[7823] | 5195040| 8|OBJT |LOCL |0 |6478 |
_ZGVZN5wxApp10InitializeERiPPcE8fileconv
[31684] | 0| 0|FUNC |GLOB |0 |UNDEF |
_ZN12wxAppConsole10InitializeERiPPc
[32485] | 2122374| 44|FUNC |GLOB |0 |956 |
_ZN12wxDocManager10InitializeEv
[40598] | 2427274| 663|FUNC |GLOB |0 |956 |
_ZN14wxPreviewFrame10InitializeEv
[34514] | 2204368| 400|FUNC |GLOB |0 |956 |
_ZN16wxColourDatabase10InitializeEv
[31434] | 2759838| 198|FUNC |GLOB |0 |956 |
_ZN16wxSplitterWindow10InitializeEP8wxWindow
[34686] | 2041478| 93|FUNC |GLOB |0 |956 |
_ZN18wxCommandProcessor10InitializeEv
[39717] | 2535086| 45|FUNC |GLOB |0 |956 |
_ZN18wxGenericValidator10InitializeEv
[33496] | 3709160| 10|FUNC |WEAK |0 |3939 |
_ZN20wxHelpControllerBase10InitializeERK8wxString
[35329] | 3709170| 10|FUNC |WEAK |0 |3940 |
_ZN20wxHelpControllerBase10InitializeERK8wxStringi
[32594] | 1326738| 957|FUNC |GLOB |0 |956 |
_ZN5wxApp10InitializeERiPPc
[39746] | 1985796| 163|FUNC |GLOB |0 |956 |
_ZN9wxAppBase10InitializeERiPPc
[12631] | 5199656| 1|OBJT |LOCL |0 |6478 |
_ZZ19FindClosestIconSizeRK6wxSizeE18s_sizesInitialized
[21056] | 5043168| 560|OBJT |LOCL |0 |5670 |
_ZZN16wxColourDatabase10InitializeEvE13wxColourTable
[28427] | 3937736| 11|OBJT |LOCL |0 |5051 |
_ZZN16wxSplitterWindow10InitializeEP8wxWindowE12__FUNCTION__
[7824] | 5195048| 8|OBJT |LOCL |0 |6478 |
_ZZN5wxApp10InitializeERiPPcE8fileconv

I do not have "_ZN5wxApp10InitializeERiPPw" in the output from nm.

Any ideas/insights?

-Tim

timbo wrote:

I posted earlier today but decided to repost with more information.

I downloaded wxPython-src-2.8.10.1 without issue and was able to build
and install wxWidgets on my Solaris 10 x86 machine without issue.
After the build/install I executed the sample/minimal application to
test, it works perfectly.

What configure flags did you use?

I then moved on to building wxPython:
1. I modified by PATH to include /opt/wx/2.8/bin
2. I set LD_LIBRARY_PATH to /opt/wx/2.8/lib
3. I modified config.py by uncommenting the lines below the "Solaris"
section.

Did you try building without that change? That was written at least 7 or 8 years ago so it may not be relevant anymore.

4. When I attempted to build I received an error message regarding
CreateBitmap missing from wxGraphicsRenderer in _gdi_wrap.cpp. After
Googling around I copied the section from wxGraphicsContext into
wxGraphicsRenderer. I'm not sure how anyone could have built without
making this change.

IIRC, if Cairo development headers and libs had been available in the wxGTK build then the real wxGraphicsContext would be available and wxPython's stub would not have been built.

5. I then built as "python2.5 setup.py build_ext --inplace --include-
dirs="/usr/X11R6/include" --force, the build succeeded (with many
warnings).
6. To test the wxPython I created PYTHONPATH as $WXDIR/wxPython,
execute python2.5, and attempt "import wx".

I receive the following error message:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/export/home/apollo/wxPython/wxPython-src-2.8.10.1/wxPython/wx/
__init__.py", line 45, in <module>
    from wx._core import *
  File "/export/home/apollo/wxPython/wxPython-src-2.8.10.1/wxPython/wx/
_core.py", line 4, in <module>
    import _core_
ImportError: ld.so.1: python2.5: fatal: relocation error: file /export/
home/apollo/wxPython/wxPython-src-2.8.10.1/wxPython/wx/_core_.so:
symbol _ZN5wxApp10InitializeERiPPw: referenced symbol not found

Are you using Sun's CC or GNU gcc? Does the wxWidgets build and the wxPython build use the same compiler (CC or gcc/g++)? What is the output of these commands?

   c++filt _ZN5wxApp10InitializeERiPPw # what it's looking for
   c++filt _ZN5wxApp10InitializeERiPPc # what you have

My guess is that it's a unicode or narrow/wide character difference in the two builds.

···

--
Robin Dunn
Software Craftsman