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

前端 未结 3 1511
小鲜肉
小鲜肉 2021-01-04 14:08

I\'m still quite new to Objective C and Xcode, but I just finished a small app that uses the openCV libopencv_core.2.4.2.dylib.

When I went to open the

相关标签:
3条回答
  • 2021-01-04 14:24

    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.

    0 讨论(0)
  • 2021-01-04 14:38

    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".

    0 讨论(0)
  • 2021-01-04 14:40

    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.

    0 讨论(0)
提交回复
热议问题