我正在尝试使用带有opencv的树莓派相机板来测试示例。该代码来自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,但我不知道如何解决该错误。

最佳答案

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

关于c - 借助开放的计算机视觉,C语言中的未定义引用,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/31233002/

10-14 16:15