Linking OpenCV 2.3 program in Mac OS X Lion: symbol(s) not found for architecture x86_64

前端 未结 1 634
说谎
说谎 2021-01-27 03:17

I\'m having a problem when trying to compile the program in this tutorial from the OpenCV 2.3 official documentation. I have created the CMakeList.txt like it\'s said in the lin

相关标签:
1条回答
  • 2021-01-27 03:58

    I noticed you are following the 2.3.x guide, but the link error is referring to 2.2.0. Which version are you using?

    Have you tried compiling it manually?

    With something like this:

    Assuming OPENCV_ROOT is set to your install location (e.g., /opt/local)

    g++ -I$OPENCV_ROOT/include -L$OPENCV_ROOT/lib -lopencv_core2.2.0 -lopencv_calib3d2.2.0 -c test.cpp
    

    If that doesn't work, have you tried running ldconfig as root? Is the install location for the opencv libraries setup in /etc/ld.so.conf (If not, you need to do this first before ldconfig will do anything useful)?

    Edit you answer with updates to these questions. And, I'll try to help you with the rest.

    EDIT :
    You might also try adding this to your ~/.profile and see it fixes it:

    export DYLD_FALLBACK_LIBRARY_PATH=/opt/local/lib
    

    Have you tried following this guide starting from Section 2 with XCode?

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