简体   繁体   English

由于存在opencv依赖关系,因此无法构建带有openCV的项目

[英]Project with openCV won't build because of opencv dependencies

I had build OpenCV from source without any errors. 我从源代码构建了OpenCV,没有任何错误。

Then I tried using OpenCV in a project and it won't compile because of the dependencies. 然后我尝试在项目中使用OpenCV,由于依赖关系,它无法编译。 All the libraries in the warning are installed but have different versions (actually, no versions' numbers added after .a and .so names). 警告中的所有库均已安装,但具有不同的版本(实际上,在.a和.so名称之后未添加任何版本的编号)。

Here's the compiling errors: 这是编译错误:

/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)

How do I get rid of the errors? 如何摆脱错误? And why do they occur? 为什么会发生?

Compilation command: 编译命令:

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

Downgrading Boost from 1.57 to 1.55 has helped. 将Boost从1.57降级到1.55有所帮助。

But I still have no idea why I had the problem to begin with. 但是我仍然不知道为什么我会遇到这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM