0

我已经使用 OpenCV 和 cmake/make 接口测试并使用了我的 ubuntu 12.04 64 位系统,但是现在我想将 OpenCV 与 Ecplipse 一起使用,比如在此处输入链接描述

我的

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 ****

我不知道我在哪里失踪,但这让我很困惑。

4

1 回答 1

2

为什么您不想将 make 项目导入 Eclipse?或者使用 cmake eclipse 项目生成器?有时可能会有点棘手,但可以让您永远摆脱与日食的束缚:)

哦,尝试lib在库名称中不包含部分,例如-lopencv_core

于 2013-11-07T19:31:15.080 回答