2016-09-29 67 views
0

我想在ubuntu 16.04上的eclipse上構建簡單的opencv程序。在eclipse上構建opencv項目失敗ubuntu

我添加包括路徑文件:

/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

到庫(-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) 

爲什麼呢?

回答

0

庫中包含文件我想錯了,它應該與/ lib中結束了,美國可以在終端使用此命令雖然找到了正確的道路:

pkg-config opencv --libs 

希望這將有助於你