开发者

Dynamic library linking issue

I am trying to link a dynamic library in my COCOA application but I am getting the following strange error:

dyld: Library not loaded: /opt/local/lib/libusb-0.1.4.dylib

I want to link this library from application (Mac OS) directory as I don't want user to have install anything. Although I have properly linked the library in frameworks and added it to target copy build phase but it's still complaining that the library is missing. Other two libraries which I linked are working fine but libusb-0.开发者_StackOverflow中文版1.4.dylib is causing problem. Could anybody please tell me how to fix this issue.

Thanks in advance for your help.


I am able to fix this issue by modifying paths in dynamic libraries using otool and install_name_tool utilities. For reference please consult: Dynamic Libraries, RPATH, and Mac OS


A dynamic library can't be moved. Its path is determined at compilation time, and cannot change.

This is certainly why you are getting the error.

You should recompile that specific library as a static one.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜