So I was working on a C++ project on Xcode, and I updated to the latest version of Xcode with recommended default settings; then I started having the following errors:
dyld: Library not loaded: /usr/local/lib/libcryptopp.dylib
Referenced from: /Users/devharsh/Library/Developer/Xcode/DerivedData/server-bohvcuztzndrrzhcoglrvuijfasj/Build/Products/Debug/server
Reason: no suitable image found. Did find:
/usr/local/lib/libcryptopp.dylib: code signature in (/usr/local/lib/libcryptopp.dylib) 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.
/usr/local/lib/libcryptopp.dylib: code signature in (/usr/local/lib/libcryptopp.dylib) 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.
/usr/local/lib/libcryptopp.dylib: code signature in (/usr/local/lib/libcryptopp.dylib) 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.
Program ended with exit code: 9
Solution:
- Go to Xcode > Targets > Build Settings
- Scroll down and go to the Signing tab
- Click on "Enable Hardened Runtime" and set it to "No"
- Recompile, and it should be fixed