Linking is jacked up.. what is -rpath? MacOS X

情到浓时终转凉″ 提交于 2019-12-01 18:20:32

http://en.wikipedia.org/wiki/Rpath_(linking)

It's a path stored in the binary to find shared libs. When you start the app from Finder, it's probably an app bundle? When app bundles are created, shared libraries are copied into the app bundle, and the paths to the bundled libraries become relative then. (@executable_path/../Frameworks/foobar). How did you create the version that works from Finder?

Does the error above occur at link-time or when starting the application from xcode? (In the latter case, try with DYLD_LIBRARY_PATH)

Also, the .so extension for libRIO instead of .dylib looks a bit suspicious.

Marco

Add the rpath in the linking phase, like in this (in qt creator) example:

LIBS += -L/usr/local/root/lib -lGui -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lpthread -Wl,-rpath,/usr/local/root/lib -lm -ldl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!