我正在遵循本指南:
使用 Eclipse Juno CDT 让 opencv 在 ubuntu 12.04 上运行。但是当我构建所有内容时出现此错误:
Building target: DisplayImage
Invoking: GCC C++ Linker
g++ -L/usr/local/lib -o "DisplayImage" ./src/DisplayImage.o -lopencv_core\ opencv_imgproc\ opencv_highgui
/usr/bin/ld: cannot find -lopencv_core opencv_imgproc opencv_highgui
collect2: ld returned 1 exit status
make: *** [DisplayImage] Error 1
在eclipse中我添加了:
opencv_core opencv_imgproc opencv_highgui
在“库(-l)”框中。如果我运行(如指南中所述):
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
所以它们似乎存在。但与指南相比,名称有点不同。我试图将 eclipse 中的包含更改为:
libopencv_core.so libopencv_imgproc.so opencv_highgui
但这无济于事。有任何想法吗?
编辑:
这就是我设置包括的方式:
这就是我设置库(链接器)的方式: