Opened 22 months ago

Closed 22 months ago

Last modified 17 months ago

#14963 closed defect (fixed)

Undefined symbol "lzma_lzma_preset" error by import

Reported by: Ishayahu Owned by:
Priority: normal Milestone:
Component: wxPython Version: stable-latest
Keywords: lzma_lzma_preset Cc:
Blocked By: Blocking:
Patch: no

Description

I installed wxPython 2.8.12.1 from source, and when I try import wx I get that error
OS: PC-BSD 9.1 x64

[ishayahu@pcbsd-8463 ~/git_source/wxPython]% python
Python 2.7.3 (default, Nov 19 2012, 20:45:55)
[GCC 4.2.1 20070831 patched [FreeBSD]] on freebsd9
Type "help", "copyright", "credits" or "license" for more information.

import wx

Traceback (most recent call last):

File "<stdin>", line 1, in <module>
File "wx/init.py", line 45, in <module>

from wx._core import *

File "wx/_core.py", line 4, in <module>

import _core_

ImportError: /usr/local/lib/libwx_gtk2u_core-2.9.so.5: Undefined symbol "lzma_lzma_preset"

Change History (13)

comment:1 Changed 22 months ago by Ishayahu

sorry for formatting error

comment:2 in reply to: ↑ description Changed 22 months ago by neis

Replying to Ishayahu:

I installed wxPython 2.8.12.1 from source, and when I try import wx I get that error

ImportError: /usr/local/lib/libwx_gtk2u_core-2.9.so.5: Undefined symbol "lzma_lzma_preset"

Something seems to be wrong with your library search path, it's apparently trying to use a library from wxWidgets-2.9 while you said you want to use wxPython 2.8.12.1...
Double check where the libraries for wxWidgets-2.8.12 ended up and what module exactly you're trying to import.

comment:3 follow-up: Changed 22 months ago by vadz

  • Resolution set to invalid
  • Status changed from new to closed

There is definitely something weird going on here, you must be using 2.9 and with the new tiff library as this is the only place where lzma is used. My recommendation would be to use the system tiff library in the first place. And if not, please recheck which libraries do you have on your system and remove or move away the unwanted ones.

comment:4 in reply to: ↑ 3 Changed 22 months ago by Ishayahu

Replying to vadz:

There is definitely something weird going on here, you must be using 2.9 and with the new tiff library as this is the only place where lzma is used. My recommendation would be to use the system tiff library in the first place. And if not, please recheck which libraries do you have on your system and remove or move away the unwanted ones.

can you say me how can I do it? What is new version of tiff from 2.9?

comment:5 follow-up: Changed 22 months ago by vadz

To use the system library, simply install the corresponding package, e.g. libtiff-dev or something like this. Check that configure says at the end that it will use the system tiff library and if it doesn't, search config.log for the messages after libtiff test to learn why didn't it detect it.

comment:6 in reply to: ↑ 5 ; follow-up: Changed 22 months ago by Ishayahu

Replying to vadz:

To use the system library, simply install the corresponding package, e.g. libtiff-dev or something like this. Check that configure says at the end that it will use the system tiff library and if it doesn't, search config.log for the messages after libtiff test to learn why didn't it detect it.

This is from my installation log. As I understand it use builtin tiff as it should...

Configured wxWidgets 2.9.5 for `x86_64-unknown-freebsd9.1'

  Which GUI toolkit should wxWidgets use?                 GTK+ 2 with support for GTK+ printing libnotify
  Should wxWidgets be compiled into single library?       no
  Should wxWidgets be linked as a shared library?         yes
  Should wxWidgets support Unicode?                       yes (using wchar_t)
  What level of wxWidgets compatibility should be enabled?
                                       wxWidgets 2.6      no
                                       wxWidgets 2.8      yes
  Which libraries should wxWidgets use?
                                       STL                no
                                       jpeg               builtin
                                       png                builtin
                                       regex              builtin
                                       tiff               builtin
                                       zlib               sys
                                       expat              builtin
                                       libmspack          no
                                       sdl                yes

This "libtiff" is the same as this tiff?

comment:7 in reply to: ↑ 6 ; follow-up: Changed 21 months ago by neis

Replying to Ishayahu:

Replying to vadz:

To use the system library, simply install the corresponding package, e.g. libtiff-dev or something like this.

This is from my installation log. As I understand it use builtin tiff as it should...

 Configured wxWidgets 2.9.5 for `x86_64-unknown-freebsd9.1'
   (snipped)
   Which libraries should wxWidgets use?
   (snipped)
                                        tiff               builtin
                                        zlib               sys

You're probably misunderstanding something: "builtin" means that a separate version of the tiff library is built into your wxWidgets library, it does not mean that you are using the library provided by your system (which would be indicated by "sys" like it it for zlib).
Now, something seems to be wrong with the libtiff we build and include ourselves, it it ends up with unresolved symbols - maybe some file missing in a filelist for bakefile?

comment:8 in reply to: ↑ 7 ; follow-up: Changed 21 months ago by Ishayahu

Replying to neis:

Now, something seems to be wrong with the libtiff we build and include ourselves, it it ends up with unresolved symbols - maybe some file missing in a filelist for bakefile?

How can I check it?

comment:9 Changed 21 months ago by Ishayahu

  • Version changed from 2.8.12 to 2.9-svn

comment:10 in reply to: ↑ 8 Changed 21 months ago by neis

Replying to Ishayahu:

How can I check it?

You could check that in your Makefile[.in], the definition of WXTIFF_OBJECTS includes something like wxtiff_tif_lzma.o among all the other files (if it really doesn't, updating the source package should help), otherwise "ldd /usr/local/lib/libwx_gtk2u_core-2.9.so" and "ldd which python" might provide somewhat helpful information and finally it still would be better to use the system tiff library: In case python references it and your using a different version compiled into wx, that's
likely to cause trouble anyway.
Finally, some information on what version exactly you are using might be helpful as well, as so far information is quite contradicting - 2.8.12.1 vs. SVN trunk (which revision, by the way?).

comment:11 Changed 21 months ago by Ishayahu

I can't find in my directory any Makefile...
The same error I have if I compile from 2.8.12.1 and from SVN...

comment:12 Changed 17 months ago by VZ

  • Resolution changed from invalid to fixed

(In [74033]) Link with liblzma when using built-in libtiff if it's available.

New version of libtiff includes code using liblzma if it's available, so we
need to link with it in this case.

Closes #14963.

comment:13 Changed 17 months ago by VZ

(In [74153]) Link with libjbig when using built-in libtiff under Unix.

If libjbig is available, the built-in libtiff build process picks it up and
uses it, requiring all the code linking with libtiff to link with it too, so
add it to the list of the libraries in this case.

This is the same change as was already done for liblzma dependency in r74033,
see #14963.

Closes #15244.

Note: See TracTickets for help on using tickets.