Qt5 + OpenCV 2.4.9 cv::imshow error

asked 2014-05-29 20:42:31 -0500

Beowulf gravatar image

updated 2014-05-29 20:44:57 -0500

Hello you all, I compiled the OpenCV statically, using CMake, with the option WITH_QT.

Everything seems to be working, but when I try to use the cv::imshow I got that error:

window_QT.cpp:-1: error: undefined reference to `_imp___ZN5QTest10keyToAsciiEN2Qt3KeyE'

C:\opencv\install\x86\mingw\staticlib/libopencv_highgui249.a(window_QT.cpp.obj):window_QT.cpp:(.text$_ZN8CvWindow13keyPressEventEP9QKeyEvent+0x16): undefined reference to `_imp___ZN5QTest10keyToAsciiEN2Qt3KeyE'

.pro:

// ...

INCLUDEPATH += C:\\opencv\\install\\include

LIBS += -L"C:\\opencv\\install\\x86\\mingw\\staticlib"
LIBS += -lopencv_highgui249 -lopencv_imgproc249 -lopencv_ml249 -lopencv_core249
LIBS += -llibjpeg -llibtiff -llibpng -llibjasper -lIlmImf -lzlib

I tried everything, and nothing.

main.cpp:

// ...
cv::Mat image = cv::imread("image.png");
cv::imshow("My Image", image);

How can I solve this? Thanks in advance.

edit retag flag offensive close merge delete

Comments

I don't recall if you must have Qt installed. Do you have it?

Yamaneko gravatar imageYamaneko ( 2014-05-31 10:39:37 -0500 )edit

Yes, I do, the last version: 5.3.

Beowulf gravatar imageBeowulf ( 2014-06-04 22:18:30 -0500 )edit