Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

rcplusplus

macrumors newbie
Original poster
Aug 7, 2012
3
0
I've been trying to solve this for a while, but I can't come up with a solution. I have a Xcode project that uses the box2d c++ library. I'm trying to link against the .dylib file, but nothing seems to work!

  1. Created a new SFML application (I used project templates provided by SFML, so the project is set up correctly for that library)
  2. Went to the "Targets", selected my application, and added my .dylib file in the "Link Binary With Libraries" section
  3. Created a new "Copy Files" build phase, set it to "Frameworks", and added the .dylib file
  4. Set the "Dynamic Library Install Name" option in the "Build Settings" tab to "@loader_path/../Frameworks/libBox2D.2.1.0.dylib"
  5. Successfully compiled my project with no errors whatsoever
  6. Ran the project and got the following runtime-error:
dyld: Library not loaded: libBox2D.2.1.0.dylib
Referenced from: /Users/****/Documents/Xcode Projects/ProjectName/DerivedData/ProjectName/Build/Products/Debug/ProjectName.app/Contents/MacOS/ProjectName
Reason: image not found​
What did I do wrong? This seems to be what everyone does to link their .dylib files to their projects. Am I missing something big? Or is the specific .dylib file simply un-linkable?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.