Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-interest Archive, May 2007
Dynamic Library Link Fails on OS X


Message 1 in thread

Using Qt 4.3 Beta.  I am building a dynamic library in one project and
linking to it in another.  The link passes on Windows and Linux, but fails
on OS X.  Am I setting up my projects incorrectly?

----------
[ DYNAMICLIB.PRO]
----------

TEMPLATE = lib
CONFIG = dll
TARGET = MyDynamicLib

HEADERS = <some headers>
SOURCES = <some sources>

----------
[EXECUTABLE.PRO]
----------

TEMPLATE = app
TARGET = MyExecutable

win32 { MY_LIB = <path to lib>/MyDynamicLib.lib }
!win32 { MY_LIB = -L<path to lib> -lMyDynamicLib }
LIBS += $$MY_LIB

HEADERS = <some headers>
SOURCES = <some sources>
----------

In my -spec macx-g++ make, I can see the -L<path to lib> -lMyDynamicLib on
the link line bug I get the error that:

dyld: Library not loaded: libMyDynamicLib.1.dylib
  Referenced from: <path to
executable>/MyExecutable.app/Contents/MacOS/MyExecutable
  Reason: image not found

Thanks,
Robert