libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lazy symbol binding failed - on MacOSX 10.7 and 10.8


From: Peter Johansson
Subject: lazy symbol binding failed - on MacOSX 10.7 and 10.8
Date: Sun, 17 Mar 2013 14:28:18 +1000
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9.2.28) Gecko/20120306 Thunderbird/3.1.20

Hi libtoolers,

I've encontered a problem on newer OSX (10.7 and 10.8) when mixing a static library (libfoo) and a dynamic library (libbar). The dynamic library is created with libtool so there is a libbar.la file whereas for the static library there is no .la file. Code in libbar uses libfoo but although the binary is created linking with '-lbar -lfoo' the function is not found by the dynamic loader and instead we get an error message:

libtool: link: g++ -g -O2 -o .libs/baz baz.o -Wl,-bind_at_load \
    ../bar/.libs/libbar.dylib ../foo/libfoo.a
dyld: lazy symbol binding failed: Symbol not found: _foo_version
  Referenced from: /Users/jari/projects/yat/bar/.libs/libbar.0.dylib
  Expected in: flat namespace

dyld: Symbol not found: _foo_version
  Referenced from: /Users/jari/projects/yat/bar/.libs/libbar.0.dylib
  Expected in: flat namespace

./link_test.sh: line 147: 80434 Trace/BPT trap: 5       ./baz


Has anyone seen anything like this? Is this a bug in the apple linker or are we using libtool incorrectly? I found this old thread from Peter O'Gorman

http://lists.gnu.org/archive/html/libtool-patches/2007-02/msg00063.html

but not sure how to translate it into a solution. I'm aware this is unlikely a libtool issue and apologize if anyone would consider this noise.

Any hint or suggestion for further investigation would be most appreciated.

Thanks,

--
Peter Johansson

Attachment: link_test.sh
Description: Bourne shell script


reply via email to

[Prev in Thread] Current Thread [Next in Thread]