Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dyld: lazy symbol binding failed: can't resolve symbol

So I've been working on a c++ project in XCode and am making use of an external framework (SFML http://www.sfml-dev.org/ ).

I recently decided to upload my project to github and then tried checking out the project on another Mac.

However, when I try to run my program on the new computer, I get this error

dyld: lazy symbol binding failed: can't resolve symbol __ZN2sf5ImageC1Ev in 
/Users/myname/Library/Developer/Xcode/DerivedData/projectname- 
fufhzxbkoeekzeayzzlrtvgajvnn/Build/Products/Debug/projectname because dependent
dylib #3  could not be loaded

I have no idea what this means and have been having a hard time finding out online what exactly the issue is.

like image 887
user1855952 Avatar asked Dec 13 '13 21:12

user1855952


1 Answers

That error message indicates that you are linking against a Shared Library (dylib) which is not available in the library path at run time when you are executing it.

If you have installed the framework in one of the standard locations (such as /Library/Frameworks) on your original build and in the same place when you checked it your and rebuilt, then you should be OK. However, there are some complexities to framework linking that can cause trouble if you are not careful, especially if you use embedded frameworks. It looks like you are not building an application, so I assume you're not embedding the framework.

Compare the installation locations of your frameworks on both the new and old computer and if they are not the same, that's likely your problem.

If things look like they are in the same place, you may need to check the DYLD_LIBRARY_PATH (good stack exchange question about dyld).

like image 75
gaige Avatar answered Nov 10 '22 04:11

gaige