0
votes

I'm trying to test an example using the raspberry pi camera board with opencv. The code is from https://github.com/robidouille/robidouille/blob/master/raspicam_cv/RaspiCamCV.c

When typing make I get the error :

Undefined reference to symbol cvSaveImage

I have the header that contains the function cvSaveImage. When I don't use cvSaveImage it compiles successfully.

How do i know wich libraries are missing? Here is my output of 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

Update: cvSaveImage is in /usr/local/lib/libopencv_imgcodecs.so.3.0.0. I have a makefile but i don't know how to resolve the error from it.

1
What library contains the cvSaveImage() function? Have you included the path and 'short' library names in the makefile statement that links everything together? Do you have a MakeFile? Where is the cvSaveImage() called from? It is not mentioned in the referenced code. - user3629249
Welcome to Stack Overflow! I edited your question to correct spelling mistakes and improve formatting and readability - please see the editing help for more information on formatting. Also please provide any additional information asked by editing in your question rather than using comments. Good luck! - Wtower
thanks i'm not a native english speaker :p - The Beast

1 Answers

0
votes

See output of pkg-config opencv --libs to find out what libraries you're missing, then add them to your config. For more information visit OpenCV 2.4.1 undefined references