Ask Your Question
0

Error building opencv 2.4.13 with Qt mingw

asked 2016-08-09 08:25:39 -0600

valentine gravatar image

Dear All,

I am trying to configure OpenCV 2.4.13 with Qt MinGW. The config with CMAKE was successful, however, when I try to build with mingw32-make command I get the following error:

C:\opencv-2.4.13\opencv\sources\modules\highgui\src\window_QT.cpp:2539:9: note: in expansion of macro 'foreach' foreach (QAction a, centralWidget->vect_QActions) ^ C:/Qt/Qt5.7.0/5.7/mingw53_32/include/QtCore/qglobal.h:963:49: error: request for member 'control' in '_container_', which is of non-class type 'int' for (variable = *_container_.i; _container_.control; _container_.control = 0) ^ C:/Qt/Qt5.7.0/5.7/mingw53_32/include/QtCore/qglobal.h:971:21: note: in expansion of macro 'Q_FOREACH' # define foreach Q_FOREACH ^ C:\opencv-2.4.13\opencv\sources\modules\highgui\src\window_QT.cpp:2539:9: note: in expansion of macro 'foreach' foreach (QAction *a, centralWidget->vect_QActions) ^ C:/Qt/Qt5.7.0/5.7/mingw53_32/include/QtCore/qglobal.h:963:70: error: request for member 'control' in '_container_', which is of non-class type 'int' for (variable = *_container_.i; _container_.control; _container_.control = 0) ^ C:/Qt/Qt5.7.0/5.7/mingw53_32/include/QtCore/qglobal.h:971:21: note: in expansion of macro 'Q_FOREACH' # define foreach Q_FOREACH ^ C:\opencv-2.4.13\opencv\sources\modules\highgui\src\window_QT.cpp:2539:9: note: in expansion of macro 'foreach' foreach (QAction *a, centralWidget->vect_QActions) ^ C:\opencv-2.4.13\opencv\sources\modules\highgui\src\window_QT.cpp: In member fun ction 'void DefaultViewPort::controlImagePosition()': C:\opencv-2.4.13\opencv\sources\modules\highgui\src\window_QT.cpp:2748:21: error : ambiguous overload for 'operator=' (operand types are 'QTransform' and 'QTrans form') matrixWorld_inv = param_matrixWorld.inverted(); ^ In file included from C:/Qt/Qt5.7.0/5.7/mingw53_32/include/QtGui/qimage.h:47:0, from C:/Qt/Qt5.7.0/5.7/mingw53_32/include/QtGui/qpixmap.h:48, from C:/Qt/Qt5.7.0/5.7/mingw53_32/include/QtGui/qicon.h:46, from C:/Qt/Qt5.7.0/5.7/mingw53_32/include/QtWidgets/qabstractbu tton.h:43, from C:/Qt/Qt5.7.0/5.7/mingw53_32/include/QtWidgets/qpushbutton .h:43, from C:/Qt/Qt5.7.0/5.7/mingw53_32/include/QtWidgets/QPushButton :1, from C:/opencv-2.4.13/opencv/sources/modules/highgui/src/window _QT.h:53, from C:\opencv-2.4.13\opencv\sources\modules\highgui\src\window _QT.cpp:47: C:/Qt/Qt5.7.0/5.7/mingw53_32/include/QtGui/qtransform.h:79:17: note: candidate: QTransform& QTransform::operator=(QTransform) QTransform &operator=(QTransform &&other) Q_DECL_NOTHROW // = default ^ C:/Qt/Qt5.7.0/5.7/mingw53_32/include/QtGui/qtransform.h:81:17: note: candidate: QTransform& QTransform::operator=(const QTransform&) QTransform &operator=(const QTransform &) Q_DECL_NOTHROW; // = default ^ modules\highgui\CMakeFiles\opencv_highgui.dir\build.make:193: recipe for target 'modules/highgui/CMakeFiles/opencv_highgui.dir/src/window_QT.cpp.obj' failed mingw32-make[2]: [modules/highgui/CMakeFiles/opencv_highgui.dir/src/window_Q T.cpp.obj] Error 1 CMakeFiles\Makefile2:2042: recipe for target 'modules/highgui/CMakeFiles/opencv_ highgui.dir/all' failed mingw32-make[1]: * [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2

Makefile:145 ... (more)

edit retag flag offensive close merge delete

Comments

1

can you try with ming64 instead ?

berak gravatar imageberak ( 2016-08-09 08:32:37 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2016-08-15 10:16:50 -0600

valentine gravatar image

Hey guys,

I found the major issue to this. When configuring opencv with mingw for Qt.5.x do not enable the "compile with Qt" option in cmake as this is only enabled for opencv with Qt.4.x. Just compiled like a charm.

Regards.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-08-09 08:25:39 -0600

Seen: 622 times

Last updated: Aug 15 '16