开发者

How do I reference a dylib?

开发者 https://www.devze.com 2023-04-12 15:39 出处:网络
I have an application written in platform-independent C++ which has been primarily developed on Windows. I\'m now trying to get it up and running on a Mac but I seem to be lost in how to link to the M

I have an application written in platform-independent C++ which has been primarily developed on Windows. I'm now trying to get it up and running on a Mac but I seem to be lost in how to link to the Mac version of a third-party library I'm using. I added the library's include and lib folders to header and library search paths respectively and it compiles/links but upon running dies开发者_StackOverflow with the following:

dyld: Library not loaded: @executable_path/../Frameworks/libsfml-system-d.2.dylib Referenced from: /Users/jdoe/Library/Developer/Xcode/DerivedData/Foobar-fonhiddwdwvgqygcegiffqkontxi/Build/Products/Debug/Foobar.app/Contents/MacOS/Foobar Reason: image not found

I can get it to run by putting the dylibs in /usr/lib but I don't think this is a good idea for distribution. How can I include the dylib inside my app bundle?


Add a copy-files build phase that copies the dylib into the Frameworks folder inside the app bundle. (When you Get Info on a copy files build phase, Frameworks is one of the destination choices.)

0

精彩评论

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

关注公众号