开发者

Library not loaded on terminal but runs ok on Xcode

开发者 https://www.devze.com 2023-01-24 09:01 出处:网络
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:

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,

Jonathan


export 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

0

精彩评论

暂无评论...
验证码 换一张
取 消