Compile problem for Raspberry Pi 3 with opencv
-
Hello guys, I'm doing a project on Rpi 3, and I use QTcreator to make a GUI application. I also try to use opencv for my code. But the problem: when compiling, error
*:-1: error: mainwindow.o: undefined reference to symbol '_ZN2cv6imreadERKNS_6StringEi'/usr/local/lib/libopencv_imgcodecs.so.3.0:-1: error: error adding symbols: DSO missing from command line*
I dont know how to fix it. Anyone has suggestion? Thank you.
This is my imported libraries in .pro fileINCLUDEPATH += /usr/local/include
INCLUDEPATH += /usr/local/include/opencv
INCLUDEPATH += /usr/local/include/opencv2
LIBS += -L/usr/local/lib
LIBS += -lopencv_core
LIBS += -lopencv_imgproc
LIBS += -lopencv_highgui
LIBS += -lopencv_ml
LIBS += -lopencv_video
LIBS += -lopencv_features2d
LIBS += -lopencv_calib3d
LIBS += -lopencv_objdetect
LIBS += -lopencv_contrib
LIBS += -lopencv_legacy
LIBS += -lopencv_flann
LIBS += -lopencv_nonfree -
Hi and welcome to devnet,
Are you developing on the RPi3 directly ? Or are you cross-compiling ?
-
You didn't answer my question: are you developing directly on the RPi3 ?
-
Good then next question, did you build OpenCV yourself ? Or did you install the one from the distribution you have on your Pi ?
-
You are missing
-lopencv_imgcodecs
in your .pro file. -
You're welcome !
Since you have it working now, please mark the thread as solved using the "Topic Tools" button so that other forum users may know a solution has been found :)