C中未定义的引用与开放的计算机视觉

时间:2015-07-05 17:21:11

标签: c opencv camera makefile raspberry-pi

我试图使用带有opencv的raspberry pi相机板测试一个例子。代码来自https://github.com/robidouille/robidouille/blob/master/raspicam_cv/RaspiCamCV.c

输入make时出错:

  

对符号cvSaveImage

的未定义引用

我的标题包含函数cvSaveImage。当我不使用cvSaveImage时,它会成功编译。

我怎么知道图书馆丢失了?这是pkg-config opencv --libs的输出:

  

/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_ocl.so /usr/local/lib/libopencv_photo.so / usr / local / lib / libopencv_stitching.so /usr/local/lib/libopencv_superres.so /usr/local/lib/libopencv_ts.a /usr/local/lib/libopencv_video.so /usr/local/lib/libopencv_videostab.so / usr / local / lib / libopencv_viz.so /usr/lib/x86_64-linux-gnu/libXext.so /usr/lib/x86_64-linux-gnu/libX11.so /usr/lib/x86_64-linux-gnu/libICE.so / usr / lib / x86_64-linux-gnu / libSM.so /usr/lib/x86_64-linux-gnu/libGL.so /usr/lib/x86_64-linux-gnu/libGLU.so -ltbb -lrt -lpthread -lm -ldl

更新cvSaveImage位于/usr/local/lib/libopencv_imgcodecs.so.3.0.0。我有一个makefile,但我不知道如何从中解决错误。

1 个答案:

答案 0 :(得分:0)

请参阅pkg-config opencv --libs的输出以找出您缺少的库,然后将它们添加到您的配置中。有关更多信息,请访问OpenCV 2.4.1 undefined references