I'm trying to use SFML 2.5.1 in a C++ Xcode project. I followed this tutorial on Youtube. After completing, when trying to build my project, I get the following error code:
dyld: Library not loaded: @rpath/sfml-system.framework/Versions/2.5.1/sfml-system
Referenced from: /Users/will/Library/Developer/Xcode/DerivedData/FirstSFMLApp-bzfbmdnymuynqtatiocyskrsacno/Build/Products/Debug/FirstSFMLApp.app/Contents/MacOS/FirstSFMLApp
Reason: no suitable image found. Did find:
/Library/Frameworks/sfml-system.framework/Versions/2.5.1/sfml-system: code signature in (/Library/Frameworks/sfml-system.framework/Versions/2.5.1/sfml-system) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.
I've ticked "Run script only when installing" under build phases as required.
Does anyone know how to resolve this issue? I'm new to both C++ and Xcode so I'm ready to believe that I've done something dumb.
Thanks in advance.
Late, but posting to help others as I came across this question first when I was looking for an answer myself.
Go to the app view, and instead of going to the "Build phases menu", now go to "Signing and Capabilities". Go to the "Hardened Runtime" subsection.
Select "Disable Library Validation".
Run main.cpp again and it should be good to go!
I believe this is related to the privacy settings for the updated OS. NB: I have previously run the 'sudo spctl --master-disable' command in Terminal to disable gatekeeper; I've heard that without doing so you may have to accept the libraries one by one, but for some disabling gatekeeper is not an option. Running this command in terminal may have been a prerequisite for the above solution working, but I can't confirm that. Good luck!