macOS Sierra dyld library not loaded
Completed
macOS Sierra version 10.12 CLion 2016.2.2 Build #CL-162.1967.7
dyld: Library not loaded: sobj4/igl4a304.dylib
Referenced from: /Applications/IBM/informix/lib/cli/iclis09b.dylib
Reason: image not found
Library is present
cd /Applications/IBM/informix/
ls
iclis09b.bundle iclit09b.bundle idmrs09a.dylib libdmr.a libifcli.dylib libifdmr.dylib libtcli.dylib libthcli.dylib
iclis09b.dylib iclit09b.dylib libcli.a libifcli.a libifdmr.a libixcli.dylib libthcli.a
Any suggestions how to solve this issue?
PS. Setting up DYLD_LIBRARY_PATH and DYLD_FALLBACK_LIBRARY_PATH environment variables did not help.
Please sign in to leave a comment.
Hi,
If it happens to you after upgrade to macOS Sierra and you use Xcode then you should probably check Xcode version. Xcode 8 is recommended version for Sierra. Also please check that
$ xcode-select -p
gives valid path.
In case if it's doesn't help or not connected to macOS upgrade please try to build your project from console
$ mkdir bld && cd bld && cmake -G "Unix Makefiles" <path to CMakeLists.txt>
Hello, I'm building from CLion with cmake
CMakeLists.txt source
You may try to list all paths in
and then try to specifically link needed libraries in
I think the issue is not connected with cmake configuration.
I think the issue is connected with macOS Sierra SIP feature. Where should be a way how to break through SIP and allow to load dynamic libraries not from system defined paths.
First I need to notify macOS to use custom defined dynlib path and allow to use it. But I didn't find out how to do it yet.
otool -L /Users/Kingfisher/Library/Caches/CLion2016.2/cmake/generated/test15-9404ba49/9404ba49/Debug/test15
/Users/Kingfisher/Library/Caches/CLion2016.2/cmake/generated/test15-9404ba49/9404ba49/Debug/test15:
iclis09b.dylib (compatibility version 0.0.0, current version 0.0.0) (Should be /Applications/IBM/informix/lib/cli/iclis09b.dylib)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0
Ok. In Xcode Version 8.0 (8A218a) the problem was solved by changing in General->Linked Frameworks and Libraries section by adding the name of dylib and changing it Status field from Required to Optional. The code was complied successfully.
Does any equivalent steps have to be made in CLion?
Got the same issue after upgrading. Cannot use any of my External Tools.
In my case I get:
dyld: Library not loaded: /usr/local/opt/jpeg/lib/libjpeg.8.dylib
Referenced from: /usr/local/opt/php56/bin/php
Reason: image not found
This solution worked for me https://stackoverflow.com/questions/32703296/dyld-library-not-loaded-usr-local-lib-libjpeg-8-dylib-homebrew-php?answertab=votes#tab-top