在eclipse ubuntu

时间:2016-09-29 09:57:06

标签: c++ eclipse opencv ubuntu

我想在ubuntu 16.04上的eclipse上构建简单的opencv程序。

我添加了包含路径文件:

/usr/include/opencv

为:

Properties-> c/c++Build -> Settings -> GCC C++ Compiler -> Includes -> include paths(-l).

添加库路径:

/usr/lib/x86_64-linux-gnu/

为:

Properties-> c/c++Build -> Settings -> GCC C++ Linker -> Libraries -> Librav search path (-L).

并添加:

opencv_core opencv_imgproc opencv_highgui

到Libraries(-l)但是当我想要构建项目时发生了这个错误:

13:10:44 **** Build of configuration Debug for project Opencv ****
make all 
Building file: ../src/OpencvTest.cpp
Invoking: GCC C++ Compiler
g++ -I/usr/include/opencv -I/home/aligoglos/Downloads/opencv-3.1.0/include/opencv -I/home/aligoglos/Downloads/opencv-3.1.0/include/opencv2 -include/home/aligoglos/Downloads/opencv-3.1.0/include/opencv/cv.h -include/home/aligoglos/Downloads/opencv-3.1.0/include/opencv2/opencv.hpp -include/home/aligoglos/Downloads/opencv-3.1.0/include/opencv/cv.hpp -include/home/aligoglos/Downloads/opencv-3.1.0/include/opencv/cvaux.h -include/home/aligoglos/Downloads/opencv-3.1.0/include/opencv/cvaux.hpp -include/home/aligoglos/Downloads/opencv-3.1.0/include/opencv/cvwimage.h -include/home/aligoglos/Downloads/opencv-3.1.0/include/opencv/cxcore.h -include/home/aligoglos/Downloads/opencv-3.1.0/include/opencv/cxcore.hpp -include/home/aligoglos/Downloads/opencv-3.1.0/include/opencv/cxeigen.hpp -include/home/aligoglos/Downloads/opencv-3.1.0/include/opencv/cxmisc.h -include/home/aligoglos/Downloads/opencv-3.1.0/include/opencv/highgui.h -include/home/aligoglos/Downloads/opencv-3.1.0/include/opencv/ml.h -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/OpencvTest.d" -MT"src/OpencvTest.d" -o "src/OpencvTest.o" "../src/OpencvTest.cpp"
In file included from :0:0:
/home/aligoglos/Downloads/opencv-3.1.0/include/opencv/cv.h:66:38: fatal error: opencv2/video/tracking_c.h: No such file or directory
compilation terminated.
src/subdir.mk:18: recipe for target 'src/OpencvTest.o' failed
make: *** [src/OpencvTest.o] Error 1

13:10:44 Build Finished (took 202ms)

为什么?

1 个答案:

答案 0 :(得分:0)

你的库包含文件我猜错了它应该以/ lib结尾,你可以在终端上使用这个命令找到正确的路径:

pkg-config opencv --libs

希望它会帮助你