I am building a program that uses openCV on a raspberry pi. I am gettng during linking relating to missing symbols. How do I fix them?
I am trying to build a program on my raspberry pi running raspbian strech. I am getting missing symbols errors when building with opencv.
^
/usr/bin/ld: /tmp/ccY2H1tz.o: undefined reference to symbol '_ZN2cv12VideoCapture3setEid'
//usr/local/lib/libopencv_videoio.so.3.4: error adding symbols: DSO missing from
command line
collect2: error: ld returned 1 exit status
pi@raspberrypi:~ $ pkg-config --modversion opencv
3.4.1
The commandline I am using to build my program is: g++ -I /usr/include -O3 hificode_OpenCV.cpp -o vl01.bin -lopencv_highgui -lopencv_imgproc -lopencv_imgcodecs -lopencv_core
However, when I run:
pi@raspberrypi:~ $ pkg-config --cflags opencv
I get:
-I/usr/local/include/opencv -I/usr/local/include
Having said the above, I am not getting any errors about missing header files. The files I am including in my code are:
include <stdio.h>
include <stdlib.h>
include <math.h>
include "opencv2/imgproc/imgproc.hpp"
include "opencv2/highgui/highgui.hpp"
include <opencv2 imgcodecs.hpp="">
How do I fix the missing symbols error during linking? Pranav