简体   繁体   中英

SFML linker error with XCode and C++ 11

I'm trying to get SFML set up on OSX, and I'm running into problems linking the library. I've downloaded and installed the dylibs and have linked them with my project in Xcode, but when I try to compile, I get this error:

dyld: Library not loaded: @rpath/libsfml-graphics.2.3.dylib
  Referenced from:/Users/Adam/Documents/Programming/CPP/SFML/Build/Products/Debug/SFML
  Reason: image not found

I've tried googling around, but I haven't really found an answer. I saw someone say to change the version of C++ in the project settings, but the version I've downloaded and installed is supposed to be compatible with C++ 11.

Could it be I'm not using clang? I'm not very well versed in the intricacies of different compilers. My project settings under the heading of "Apple LLVM 6.1 - Language - C++" are as follows:

C++ Language Dialect: GNU++11 [-std=gnu++11]
C++ Standard Library: libc++ (LLVM C++ standard library with C++11 support)
Enable C++ Exceptions: Yes
Enable C++ Runtime Types: Yes

Are you following the tutorial at?: http://www.sfml-dev.org/tutorials/2.2/start-osx.php

Also, make sure your libraries are loaded in the "Build Phases" for your target, also make sure that your C++ 11 configurations are also changed on your target and not just in your project (double check). While at that also check the "Library search paths" value on your target "Build Settings"

This looks more like a missing library than a C++11 problem.

For even more details check the "Report navigator" for the latest build attempt, make sure to activate the "All messages" option, you can expand the errors and get valuable information, like where is it looking for the libraries.

Figured it out.

I needed to copy the contents of the extlibs folder in the SFML download into my /Library/Frameworks folder.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM