Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

jerrry94087

macrumors newbie
Original poster
Nov 6, 2010
3
0
I am trying to build my shared library. It is dependent on another library /opt/local/xxx/lib/libxxx.dylib:
g++ -shared -fPIC -o libmy.dylib my.o -L/opt/local/xxx/lib -lxxx

But when I run otool -L libmy.dylib, I see this:
@executable_path/../lib/libxxx.dylib (compatibility version 0.0.0, current version 0.0.0)
...

Why gcc makes libmy.dylib to depend on nonexistent library under @executable_path/ even though it sees that libxxx.dylib is under /opt/local/?

How to make dependency path correct?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.