【发布时间】:2016-04-29 12:17:54
【问题描述】:
我已经从源代码构建 OpenCV 没有任何错误。
然后我尝试在项目中使用 OpenCV,但由于依赖关系,它无法编译。警告中的所有库都已安装,但版本不同(实际上,.a 和 .so 名称后没有添加版本号)。
这是编译错误:
/usr/bin/ld: warning: libavcodec.so.53, needed by /usr/lib/i386-linux-gnu/libopencv_highgui.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libavformat.so.53, needed by /usr/lib/i386-linux-gnu/libopencv_highgui.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libavutil.so.51, needed by /usr/lib/i386-linux-gnu/libopencv_highgui.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libswscale.so.2, needed by /usr/lib/i386-linux-gnu/libopencv_highgui.so, not found (try using -rpath or -rpath-link)
如何消除错误?为什么会发生?
编译命令:
g++ -std=c++11 -Wall -gdwarf-3 -o dist/Debug/GNU-Linux-x86/rankcollection build/Debug/GNU-Linux-x86/QueryCollection.o build/Debug/GNU-Linux-x86/main.o -L/usr/local/lib -L/usr/lib/i386-linux-gnu -lboost_filesystem -lopencv_core -lboost_program_options -lopencv_imgproc -lopencv_features2d -lopencv_flann -lopencv_nonfree -lboost_system -lopencv_highgui -std=c++11
【问题讨论】:
-
显示您的
Makefile或编译命令 -
g++ -std=c++11 -Wall -gdwarf-3 -o dist/Debug/GNU-Linux-x86/rankcollection build/Debug/GNU-Linux-x86/QueryCollection.o build/调试/GNU-Linux-x86/main.o -L/usr/local/lib -L/usr/lib/i386-linux-gnu -lboost_filesystem -lopencv_core -lboost_program_options -lopencv_imgproc -lopencv_features2d -lopencv_flann -lopencv_nonfree -lboost_system -lopencv_highgui - std=c++11
-
不是评论 - 很难阅读。请点击您的问题下方的
edit并进行更新。