2
我正在comp-net(http://conv-net.sourceforge.net/)深度學習庫opencv和C++在我的mac osx上,我似乎無法解決這個錯誤。這似乎是一個連接問題。所有的opencv庫都是爲64位編譯的,我試圖在cmake中設置-m64標誌,但是nope仍然不能正常工作。_cvLoadImage未定義的符號鏈接問題
我不知道哪個庫_cvLoadImage()鏈接到?我正確鏈接到正確的庫,但不能解決這一個錯誤?????
Undefined symbols for architecture x86_64:
"_cvLoadImage", referenced from:
_main in testimg.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [testimg] Error 1
make[1]: *** [CMakeFiles/testimg.dir/all] Error 2
我做了鏈接器的輸出-v,它顯示了這個...
Linking CXX executable testimg
Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.0.0
Thread model: posix
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -dynamic -arch x86_64 -macosx_version_min 10.10.0 -o testimg -search_paths_first -headerpad_max_install_names CMakeFiles/testimg.dir/tst/testimg.cpp.o libcvconvnet.a -lopencv_core -lopencv_highgui -lexpat -lopencv_imgproc -lopencv_photo -lopencv_shape -lopencv_features2d -lopencv_ml -lopencv_objdetect -lc++ -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/lib/darwin/libclang_rt.osx.a
在HighGUI模塊中找到'cvLoadImage()'。你知道你在哪裏安裝OpenCV,如果是的話,你可以運行'nm /usr/local/lib/libopencv_highgui.dylib | grep cvLoadImage'(或類似的;適當地改變路徑),並告訴我們是否得到了類似於'0000000000016ef0 T _cvLoadImage'的東西? –
謝謝:)它工作! – pbu
@IwillnotexistIdonotexist將該評論添加爲答案。 – karlphillip