Library not loaded on terminal but runs ok on Xcode
I built a command line tool within Xcode and it runs ok, but when I try to run it from the terminal it complains about one of my libs:
MacBook:Debug Jonathan$ ./MyApp
dyld: Library not loaded: /Users/Jonathan/Library/Frameworks/Josk.framework/Versions/A/Josk
Referenced from: /Users/Jonathan/Development/C++/My开发者_如何学JAVAApp/build/Debug/./MyApp
Reason: image not found
Trace/BPT trap
on my MyApp project I added a copy phase (destination: framework, no path and didn't mark the only-on-installing checkbox) to the target and on the directory of MyApp I can see the Josk.framework copied.
Thanks,
Jonathanexport DYLD_FRAMEWORK_PATH=/Users/Jonathan/Library/Frameworks
or copy Josk.framework to /Users/Jonathan/Library/Frameworks
For deployment, there are various options such as @executable_path, @loader_path, @rpath.
see, man dyld
精彩评论