cannot use c++ methods of openCV

asked 2015-12-14 07:06:59 -0600

besic gravatar image

I use QT creator (QT 5.5.1)+MinGW and OpenCV 2.4.11 binaries I try to link opencv libraries in qt creator by following code:

LIBS += -L$$PWD/../../OpenCV/opencv/build/x86/vc12/bin/ -lopencv_core2411 -lopencv_highgui2411 -lopencv_objdetect2411 -lopencv_imgproc2411

All OK if i use simple C funcitons, like cvLoadImageM("img.jpg"), but when i try to use C++ version of this function imread("img.jpg") i get error that it is undefined.

It seems that there is some linker error, but i don't understand how to fix it... Can you help me ?

edit retag flag offensive close merge delete


you just cannot use the vc12 prebuild libs with mingw, but you will have to build the opencv libs wirh mingw (and cmake) before doing anything else.

berak gravatar imageberak ( 2015-12-14 07:35:34 -0600 )edit

Thank you for your reply. While I was not able to rebuild opencv with mingw

besic gravatar imagebesic ( 2015-12-14 08:02:50 -0600 )edit