dyld not loaded Reason: image not found libopencv_core.2.4.dylib

。_饼干妹妹 提交于 2019-11-30 18:31:24

I had the same problem. i keep all .dylib in system root directory usr/lib it working fine. At the run time .o file not get .dylib file path then it gives an error.

I found a better solution: recompiling openCV in Xcode and set the @executable_path/../Frameworks in the build settings, for every .dylib you compile - now the .dylibs themselves always "know where they are".

Since other answers are not clear enough;

Assume your dylib files are located in /usr/local/opt/opencv3/lib

sudo ln -s /usr/local/opt/opencv3/lib/*.dylib /usr/local/lib

will solve this problem. Be aware that /usr/lib is protected by system in MacOS, thus you should use /usr/local/lib.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!