OpenCV与Eclipse

时间:2013-11-07 13:55:42

标签: eclipse opencv ubuntu gcc eclipse-cdt

我已经使用OpenCV和cmake / make接口测试并使用了我的ubuntu 12.04 64位系统,但现在我想将OpenCV与Ecplipse一起使用,如enter link description here

pkg-config --cflags opencv

输出

-I/usr/local/include/opencv -I/usr/local/include

和    pkg-config --libs opencv 输出

/usr/local/lib/libopencv_calib3d.so /usr/local/lib/libopencv_contrib.so         /usr/local/lib/libopencv_core.so /usr/local/lib/libopencv_features2d.so /usr/local/lib/libopencv_flann.so /usr/local/lib/libopencv_gpu.so /usr/local/lib/libopencv_highgui.so /usr/local/lib/libopencv_imgproc.so /usr/local/lib/libopencv_legacy.so /usr/local/lib/libopencv_ml.so /usr/local/lib/libopencv_nonfree.so /usr/local/lib/libopencv_objdetect.so /usr/local/lib/libopencv_photo.so /usr/local/lib/libopencv_stitching.so /usr/local/lib/libopencv_ts.so /usr/local/lib/libopencv_video.so /usr/local/lib/libopencv_videostab.so

我设置我的项目就像教程所说,但每当我尝试构建项目时我都有

make all 
Building file: ../src/OpenCVTryOut.cpp
Invoking: GCC C++ Compiler
g++ -I/usr/local/include/opencv2 -I/usr/local/include -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/OpenCVTryOut.d" -MT"src/OpenCVTryOut.d" -o "src/OpenCVTryOut.o" "../src/OpenCVTryOut.cpp"
Finished building: ../src/OpenCVTryOut.cpp

Building target: OpenCVTryOut
Invoking: GCC C++ Linker
g++ -L/usr/local/lib -o "OpenCVTryOut"  ./src/OpenCVTryOut.o   -llibopencv_highgui -llibopencv_imgproc -llibopencv_core
/usr/bin/ld: cannot find -llibopencv_highgui
/usr/bin/ld: cannot find -llibopencv_imgproc
/usr/bin/ld: cannot find -llibopencv_core
collect2: ld returned 1 exit status
make: *** [OpenCVTryOut] Error 1
    **** Build Finished ****

我不知道我在哪里,但它让我很困惑。

1 个答案:

答案 0 :(得分:2)

为什么你不想将make项目导入eclipse?或者使用cmake eclipse项目生成器?有时候它可能有点棘手,但是你可以从你的项目中解除与永远的蚀刻:)

哦,尝试在lib

等库名中没有-lopencv_core个部分