Ask Your Question

D3CIM8OR's profile - activity

2019-05-07 20:06:06 -0600 received badge  Supporter (source)
2019-05-07 20:06:04 -0600 marked best answer Problem compiling kalman filter program

Hello, I am having some trouble compiling the sample kalman filter program found on https://docs.opencv.org/trunk/de/d70/...

I get the following output when I try to build the program

g++ -o  kalman kalman.o -lopencv_core -lopencv_tracking -lopencv_highgui -lopencv_imgproc -lopencv_imgcodecs -lopencv_videoio -lopencv_objdetect
/usr/bin/ld: kalman.o: undefined reference to symbol '_ZN2cv12KalmanFilter7predictERKNS_3MatE'
/usr/bin/ld: /usr/lib/libopencv_video.so.4.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [Makefile:9: kalman] Error 1

I am using my own Makefile for this, and this is the LIB variable in my makefile

LIBS=-lopencv_core -lopencv_tracking -lopencv_highgui -lopencv_imgproc -lopencv_imgcodecs -lopencv_videoio -lopencv_objdetect

And just in case, here is my entire Makefile:

CC=g++
TARGET=kalman
SRC=kalman.cpp
LIBS=-lopencv_core -lopencv_tracking -lopencv_highgui -lopencv_imgproc -lopencv_imgcodecs -lopencv_videoio -lopencv_objdetect
OBJ=kalman.o
%.o: %.cpp
        $(CC) -c -o $@ $< $(LIBS)
kalman: $(OBJ)
        $(CC) -o  $@ $^ $(LIBS)

The #includes for this program seem to suggest that the only libraries that are required to be linked are -lopencv_core, -lopencv_tracking, and -lopencv_highgui I originally had -lopencv_tracking as the very last library to link and I got the exact same error. I then promoted it to the second library to be linked and that yielded the same error.

Thanks!

2019-05-07 20:06:04 -0600 received badge  Scholar (source)
2019-04-27 13:06:56 -0600 asked a question Problem compiling kalman filter program

Problem compiling kalman filter program Hello, I am having some trouble compiling the sample kalman filter program found