在eclipse中找不到Opencv库文件
Posted
技术标签:
【中文标题】在eclipse中找不到Opencv库文件【英文标题】:Opencv library files cannot find in eclipse 【发布时间】:2013-11-26 10:13:55 【问题描述】:我正在尝试开发一个使用 opencv 的简单 c++ 项目。我关注了http://docs.opencv.org/doc/tutorials/introduction/linux_eclipse/linux_eclipse.html 网站。 但是 eclipse 显示像
这样的错误/usr/bin/ld: cannot find -llibopencv_photo
/usr/bin/ld: cannot find -llibopencv_stitching
/usr/bin/ld: cannot find -llibopencv_superres
/usr/bin/ld: cannot find -llibopencv_ts
/usr/bin/ld: cannot find -llibopencv_video
/usr/bin/ld: cannot find -llibopencv_videostab
/usr/bin/ld: cannot find -llibopencv_calib3d
/usr/bin/ld: cannot find -llibopencv_contrib
/usr/bin/ld: cannot find -llibopencv_ocl
/usr/bin/ld: cannot find -llibopencv_core
/usr/bin/ld: cannot find -llibopencv_core
/usr/bin/ld: cannot find -llibopencv_flann
/usr/bin/ld: cannot find -llibopencv_gpu
/usr/bin/ld: cannot find -llibopencv_highgui
/usr/bin/ld: cannot find -llibopencv_imgproc
/usr/bin/ld: cannot find -llibopencv_legacy
/usr/bin/ld: cannot find -llibopencv_ml
/usr/bin/ld: cannot find -llibopencv_nonfree
/usr/bin/ld: cannot find -llibopencv_objdetect
collect2: ld returned 1 exit status
make: *** [MyProject] Error 1`
我已通过以下方式包含库及其路径。
项目–>属性
在 C/C++ 构建 -> 设置中。
In GCC C++ Compiler ->Includes.
In Include paths(-l) I have added /usr/local/include/opencv.
In GCC C++ Linker
I have added the path (-L) as /usr/local/lib and also library names.
谁能告诉我这个错误的原因是什么?
【问题讨论】:
【参考方案1】:您必须添加不带前缀“lib”的库名称
【讨论】:
以上是关于在eclipse中找不到Opencv库文件的主要内容,如果未能解决你的问题,请参考以下文章
在.pch文件中找不到opencv2 / opencv.hpp文件
eclipse部署web项目至本地tomcat, webapps中找不到