Lemon
Lemon copied to clipboard
Cannot compile with qt5.11
╭─ag@AprilGrimoire ~/Softwares/Lemon ‹master*›
╰─$ ./make
Updating 'Lemon_zh_CN.qm'...
Generated 392 translation(s) (0 finished and 392 unfinished)
Updating 'Lemon_zh_CN.qm'...
Generated 392 translation(s) (392 finished and 0 unfinished)
make -f Makefile.Release
make[1]: Entering directory '/home/ag/Softwares/Lemon'
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtWidgets -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtNetwork -isystem /usr/include/qt5/QtCore -Irelease -isystem /usr/include/libdrm -I. -I/usr/lib64/qt5/mkspecs/linux-g++ -o release/testcaseeditwidget.o testcaseeditwidget.cpp
testcaseeditwidget.cpp: In constructor ‘TestCaseEditWidget::TestCaseEditWidget(QWidget*)’:
testcaseeditwidget.cpp:33:36: error: invalid use of incomplete type ‘class QAction’
deleteAction = new QAction(this);
^
In file included from /usr/include/qt5/QtGui/qtextlayout.h:49,
from /usr/include/qt5/QtGui/qabstracttextdocumentlayout.h:45,
from /usr/include/qt5/QtGui/QtGui:5,
from testcaseeditwidget.h:24,
from testcaseeditwidget.cpp:20:
/usr/include/qt5/QtGui/qevent.h:62:7: note: forward declaration of ‘class QAction’
class QAction;
^~~~~~~
testcaseeditwidget.cpp:34:17: error: invalid use of incomplete type ‘class QAction’
deleteAction->setShortcutContext(Qt::WidgetShortcut);
^~
In file included from /usr/include/qt5/QtGui/qtextlayout.h:49,
from /usr/include/qt5/QtGui/qabstracttextdocumentlayout.h:45,
from /usr/include/qt5/QtGui/QtGui:5,
from testcaseeditwidget.h:24,
from testcaseeditwidget.cpp:20:
/usr/include/qt5/QtGui/qevent.h:62:7: note: forward declaration of ‘class QAction’
class QAction;
^~~~~~~
testcaseeditwidget.cpp:35:17: error: invalid use of incomplete type ‘class QAction’
deleteAction->setShortcut(QKeySequence::Delete);
^~
In file included from /usr/include/qt5/QtGui/qtextlayout.h:49,
from /usr/include/qt5/QtGui/qabstracttextdocumentlayout.h:45,
from /usr/include/qt5/QtGui/QtGui:5,
from testcaseeditwidget.h:24,
from testcaseeditwidget.cpp:20:
/usr/include/qt5/QtGui/qevent.h:62:7: note: forward declaration of ‘class QAction’
class QAction;
^~~~~~~
testcaseeditwidget.cpp:36:17: error: invalid use of incomplete type ‘class QAction’
deleteAction->setEnabled(false);
^~
In file included from /usr/include/qt5/QtGui/qtextlayout.h:49,
from /usr/include/qt5/QtGui/qabstracttextdocumentlayout.h:45,
from /usr/include/qt5/QtGui/QtGui:5,
from testcaseeditwidget.h:24,
from testcaseeditwidget.cpp:20:
/usr/include/qt5/QtGui/qevent.h:62:7: note: forward declaration of ‘class QAction’
class QAction;
^~~~~~~
testcaseeditwidget.cpp:54:43: error: no matching function for call to ‘TestCaseEditWidget::connect(QAction*&, const char [13], TestCaseEditWidget*, const char [20])’
this, SLOT(deleteSingleCase()));
^
In file included from /usr/include/qt5/QtCore/qabstractanimation.h:43,
from /usr/include/qt5/QtCore/QtCore:5,
from testcaseeditwidget.h:23,
from testcaseeditwidget.cpp:20:
/usr/include/qt5/QtCore/qobject.h:208:36: note: candidate: ‘static QMetaObject::Connection QObject::connect(const QObject*, const char*, const QObject*, const char*, Qt::ConnectionType)’
static QMetaObject::Connection connect(const QObject *sender, const char *signal,
^~~~~~~
/usr/include/qt5/QtCore/qobject.h:208:36: note: no known conversion for argument 1 from ‘QAction*’ to ‘const QObject*’
/usr/include/qt5/QtCore/qobject.h:211:36: note: candidate: ‘static QMetaObject::Connection QObject::connect(const QObject*, const QMetaMethod&, const QObject*, const QMetaMethod&, Qt::ConnectionType)’
static QMetaObject::Connection connect(const QObject *sender, const QMetaMethod &signal,
^~~~~~~
/usr/include/qt5/QtCore/qobject.h:211:36: note: no known conversion for argument 1 from ‘QAction*’ to ‘const QObject*’
/usr/include/qt5/QtCore/qobject.h:463:32: note: candidate: ‘QMetaObject::Connection QObject::connect(const QObject*, const char*, const char*, Qt::ConnectionType) const’
inline QMetaObject::Connection QObject::connect(const QObject *asender, const char *asignal,
^~~~~~~
/usr/include/qt5/QtCore/qobject.h:463:32: note: no known conversion for argument 1 from ‘QAction*’ to ‘const QObject*’
/usr/include/qt5/QtCore/qobject.h:228:43: note: candidate: ‘template<class Func1, class Func2> static QMetaObject::Connection QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, const typename QtPrivate::FunctionPointer<Func2>::Object*, Func2, Qt::ConnectionType)’
static inline QMetaObject::Connection connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal,
^~~~~~~
/usr/include/qt5/QtCore/qobject.h:228:43: note: template argument deduction/substitution failed:
/usr/include/qt5/QtCore/qobject.h: In substitution of ‘template<class Func1, class Func2> static QMetaObject::Connection QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, const typename QtPrivate::FunctionPointer<Func2>::Object*, Func2, Qt::ConnectionType) [with Func1 = const char*; Func2 = const char*]’:
testcaseeditwidget.cpp:54:43: required from here
/usr/include/qt5/QtCore/qobject.h:228:43: error: no type named ‘Object’ in ‘struct QtPrivate::FunctionPointer<const char*>’
/usr/include/qt5/QtCore/qobject.h:260:13: note: candidate: ‘template<class Func1, class Func2> static typename std::enable_if<((int)(QtPrivate::FunctionPointer<Func2>::ArgumentCount) >= 0), QMetaObject::Connection>::type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, Func2)’
connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, Func2 slot)
^~~~~~~
/usr/include/qt5/QtCore/qobject.h:260:13: note: template argument deduction/substitution failed:
testcaseeditwidget.cpp:54:43: note: candidate expects 3 arguments, 4 provided
this, SLOT(deleteSingleCase()));
^
In file included from /usr/include/qt5/QtCore/qabstractanimation.h:43,
from /usr/include/qt5/QtCore/QtCore:5,
from testcaseeditwidget.h:23,
from testcaseeditwidget.cpp:20:
/usr/include/qt5/QtCore/qobject.h:269:13: note: candidate: ‘template<class Func1, class Func2> static typename std::enable_if<(((int)(QtPrivate::FunctionPointer<Func2>::ArgumentCount) >= 0) && (! QtPrivate::FunctionPointer<Func2>::IsPointerToMemberFunction)), QMetaObject::Connection>::type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, const QObject*, Func2, Qt::ConnectionType)’
connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, const QObject *context, Func2 slot,
^~~~~~~
/usr/include/qt5/QtCore/qobject.h:269:13: note: template argument deduction/substitution failed:
/usr/include/qt5/QtCore/qobject.h: In substitution of ‘template<class Func1, class Func2> static typename std::enable_if<(((int)(QtPrivate::FunctionPointer<Func2>::ArgumentCount) >= 0) && (! QtPrivate::FunctionPointer<Func2>::IsPointerToMemberFunction)), QMetaObject::Connection>::type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, const QObject*, Func2, Qt::ConnectionType) [with Func1 = const char*; Func2 = const char*]’:
testcaseeditwidget.cpp:54:43: required from here
/usr/include/qt5/QtCore/qobject.h:269:13: error: no type named ‘type’ in ‘struct std::enable_if<false, QMetaObject::Connection>’
/usr/include/qt5/QtCore/qobject.h:300:13: note: candidate: ‘template<class Func1, class Func2> static typename std::enable_if<(QtPrivate::FunctionPointer<Func2>::ArgumentCount == -1), QMetaObject::Connection>::type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, Func2)’
connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, Func2 slot)
^~~~~~~
/usr/include/qt5/QtCore/qobject.h:300:13: note: template argument deduction/substitution failed:
testcaseeditwidget.cpp:54:43: note: candidate expects 3 arguments, 4 provided
this, SLOT(deleteSingleCase()));
^
In file included from /usr/include/qt5/QtCore/qabstractanimation.h:43,
from /usr/include/qt5/QtCore/QtCore:5,
from testcaseeditwidget.h:23,
from testcaseeditwidget.cpp:20:
/usr/include/qt5/QtCore/qobject.h:308:13: note: candidate: ‘template<class Func1, class Func2> static typename std::enable_if<(QtPrivate::FunctionPointer<Func2>::ArgumentCount == -1), QMetaObject::Connection>::type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, const QObject*, Func2, Qt::ConnectionType)’
connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, const QObject *context, Func2 slot,
^~~~~~~
/usr/include/qt5/QtCore/qobject.h:308:13: note: template argument deduction/substitution failed:
/usr/include/qt5/QtCore/qobject.h: In substitution of ‘template<class Func1, class Func2> static typename std::enable_if<(QtPrivate::FunctionPointer<Func2>::ArgumentCount == -1), QMetaObject::Connection>::type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, const QObject*, Func2, Qt::ConnectionType) [with Func1 = const char*; Func2 = const char*]’:
testcaseeditwidget.cpp:54:43: required from here
/usr/include/qt5/QtCore/qobject.h:308:13: error: no type named ‘Object’ in ‘struct QtPrivate::FunctionPointer<const char*>’
testcaseeditwidget.cpp: In member function ‘void TestCaseEditWidget::fileListSelectionChanged()’:
testcaseeditwidget.cpp:158:21: error: invalid use of incomplete type ‘class QAction’
deleteAction->setEnabled(true);
^~
In file included from /usr/include/qt5/QtGui/qtextlayout.h:49,
from /usr/include/qt5/QtGui/qabstracttextdocumentlayout.h:45,
from /usr/include/qt5/QtGui/QtGui:5,
from testcaseeditwidget.h:24,
from testcaseeditwidget.cpp:20:
/usr/include/qt5/QtGui/qevent.h:62:7: note: forward declaration of ‘class QAction’
class QAction;
^~~~~~~
testcaseeditwidget.cpp:160:21: error: invalid use of incomplete type ‘class QAction’
deleteAction->setEnabled(false);
^~
In file included from /usr/include/qt5/QtGui/qtextlayout.h:49,
from /usr/include/qt5/QtGui/qabstracttextdocumentlayout.h:45,
from /usr/include/qt5/QtGui/QtGui:5,
from testcaseeditwidget.h:24,
from testcaseeditwidget.cpp:20:
/usr/include/qt5/QtGui/qevent.h:62:7: note: forward declaration of ‘class QAction’
class QAction;
^~~~~~~
make[1]: *** [Makefile.Release:941: release/testcaseeditwidget.o] Error 1
make[1]: Leaving directory '/home/ag/Softwares/Lemon'
make: *** [Makefile:40: release] Error 2
I found that adding '#include <qaction.h>' in some files solves this problem.