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