Project

General

Profile

Error using Qt 5.4.1 and Wt at the same time

Added by Freddy Martinez Garcia almost 9 years ago

Hi guys...

How can I use Wt and Qt5 in the same project ??

I'm trying to do that and when I add the Wt libraries to my .pro file in the Qt Creator I have the following error:

In file included from ../qt_wt_learn/main.cpp:1:
In file included from ../qt_wt_learn/MainWindow.h:4:
In file included from /Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Versions/5/Headers/QMainWindow:1:
In file included from /Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Versions/5/Headers/qmainwindow.h:37:
In file included from /Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Headers/qwidget.h:41:
In file included from /usr/local/include/QtGui/qpalette.h:47:
In file included from /usr/local/include/QtGui/qbrush.h:53:
In file included from /usr/local/include/QtGui/qpixmap.h:49:
In file included from /usr/local/include/QtCore/qsharedpointer.h:50:
/usr/local/include/QtCore/qsharedpointer_impl.h:435:17: warning: 'register' storage class specifier is deprecated [-Wdeprecated-register]
register int tmp = o->strongref;
^~~~~~~~~
/usr/local/include/QtCore/qsharedpointer_impl.h:822:5: warning: 'register' storage class specifier is deprecated [-Wdeprecated-register]
register X *ptr = static_cast<X *>(src.data()); // if you get an error in this line, the cast is invalid
^~~~~~~~~
/usr/local/include/QtCore/qsharedpointer_impl.h:834:5: warning: 'register' storage class specifier is deprecated [-Wdeprecated-register]
register X *ptr = dynamic_cast<X *>(src.data()); // if you get an error in this line, the cast is invalid
^~~~~~~~~
/usr/local/include/QtCore/qsharedpointer_impl.h:848:5: warning: 'register' storage class specifier is deprecated [-Wdeprecated-register]
register X *ptr = const_cast<X *>(src.data()); // if you get an error in this line, the cast is invalid
^~~~~~~~~
/usr/local/include/QtCore/qsharedpointer_impl.h:868:5: warning: 'register' storage class specifier is deprecated [-Wdeprecated-register]
register X *ptr = qobject_cast<X *>(src.data());
^~~~~~~~~
In file included from ../qt_wt_learn/main.cpp:1:
In file included from ../qt_wt_learn/MainWindow.h:4:
In file included from /Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Versions/5/Headers/QMainWindow:1:
In file included from /Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Versions/5/Headers/qmainwindow.h:37:
In file included from /Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Headers/qwidget.h:45:
/Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Headers/qsizepolicy.h:46:5: error: expected expression
Q_GADGET
^
/usr/local/include/QtCore/qobjectdefs.h:173:18: note: expanded from macro 'Q_GADGET'
#define Q_GADGET \
^
In file included from ../qt_wt_learn/main.cpp:1:
In file included from ../qt_wt_learn/MainWindow.h:4:
In file included from /Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Versions/5/Headers/QMainWindow:1:
In file included from /Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Versions/5/Headers/qmainwindow.h:37:
In file included from /Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Headers/qwidget.h:45:
/Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Headers/qsizepolicy.h:44:24: error: variable has incomplete type 'class Q_WIDGETS_EXPORT'
class Q_WIDGETS_EXPORT QSizePolicy
^
/Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Headers/qsizepolicy.h:44:7: note: forward declaration of 'Q_WIDGETS_EXPORT'
class Q_WIDGETS_EXPORT QSizePolicy
^
/Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Headers/qsizepolicy.h:158:31: error: 'QSizePolicy' is not a class, namespace, or scoped enumeration
Q_DECLARE_OPERATORS_FOR_FLAGS(QSizePolicy::ControlTypes)
^
/usr/local/include/QtCore/qglobal.h:2356:32: note: expanded from macro 'Q_DECLARE_OPERATORS_FOR_FLAGS'
Q_DECL_CONSTEXPR inline QFlags<Flags::enum_type> operator|(Flags::enum_type f1, Flags::enum_type f2) \
^
/Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Headers/qsizepolicy.h:44:24: note: 'QSizePolicy' declared here
class Q_WIDGETS_EXPORT QSizePolicy
^
/Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Headers/qsizepolicy.h:158:31: error: 'QSizePolicy' is not a class, namespace, or scoped enumeration
Q_DECLARE_OPERATORS_FOR_FLAGS(QSizePolicy::ControlTypes)
^
/usr/local/include/QtCore/qglobal.h:2356:60: note: expanded from macro 'Q_DECLARE_OPERATORS_FOR_FLAGS'
Q_DECL_CONSTEXPR inline QFlags<Flags::enum_type> operator|(Flags::enum_type f1, Flags::enum_type f2) \
^
/Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Headers/qsizepolicy.h:44:24: note: 'QSizePolicy' declared here
class Q_WIDGETS_EXPORT QSizePolicy
^
/Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Headers/qsizepolicy.h:158:31: error: 'QSizePolicy' is not a class, namespace, or scoped enumeration
Q_DECLARE_OPERATORS_FOR_FLAGS(QSizePolicy::ControlTypes)
^
/usr/local/include/QtCore/qglobal.h:2356:81: note: expanded from macro 'Q_DECLARE_OPERATORS_FOR_FLAGS'
Q_DECL_CONSTEXPR inline QFlags<Flags::enum_type> operator|(Flags::enum_type f1, Flags::enum_type f2) \
^
/Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Headers/qsizepolicy.h:44:24: note: 'QSizePolicy' declared here
class Q_WIDGETS_EXPORT QSizePolicy
^
/Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Headers/qsizepolicy.h:158:31: error: 'QSizePolicy' is not a class, namespace, or scoped enumeration
Q_DECLARE_OPERATORS_FOR_FLAGS(QSizePolicy::ControlTypes)
^
/usr/local/include/QtCore/qglobal.h:2357:17: note: expanded from macro 'Q_DECLARE_OPERATORS_FOR_FLAGS'
{ return QFlags<Flags::enum_type>(f1) | f2; } \
^
/Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Headers/qsizepolicy.h:44:24: note: 'QSizePolicy' declared here
class Q_WIDGETS_EXPORT QSizePolicy
^
/Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Headers/qsizepolicy.h:158:31: error: 'QSizePolicy' is not a class, namespace, or scoped enumeration
Q_DECLARE_OPERATORS_FOR_FLAGS(QSizePolicy::ControlTypes)
^
/usr/local/include/QtCore/qglobal.h:2358:32: note: expanded from macro 'Q_DECLARE_OPERATORS_FOR_FLAGS'
Q_DECL_CONSTEXPR inline QFlags<Flags::enum_type> operator|(Flags::enum_type f1, QFlags<Flags::enum_type> f2) \
^
/Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Headers/qsizepolicy.h:44:24: note: 'QSizePolicy' declared here
class Q_WIDGETS_EXPORT QSizePolicy
^
/Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Headers/qsizepolicy.h:158:31: error: 'QSizePolicy' is not a class, namespace, or scoped enumeration
Q_DECLARE_OPERATORS_FOR_FLAGS(QSizePolicy::ControlTypes)
^
/usr/local/include/QtCore/qglobal.h:2358:60: note: expanded from macro 'Q_DECLARE_OPERATORS_FOR_FLAGS'
Q_DECL_CONSTEXPR inline QFlags<Flags::enum_type> operator|(Flags::enum_type f1, QFlags<Flags::enum_type> f2) \
^
/Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Headers/qsizepolicy.h:44:24: note: 'QSizePolicy' declared here
class Q_WIDGETS_EXPORT QSizePolicy
^
/Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Headers/qsizepolicy.h:158:31: error: 'QSizePolicy' is not a class, namespace, or scoped enumeration
Q_DECLARE_OPERATORS_FOR_FLAGS(QSizePolicy::ControlTypes)
^
/usr/local/include/QtCore/qglobal.h:2358:88: note: expanded from macro 'Q_DECLARE_OPERATORS_FOR_FLAGS'
Q_DECL_CONSTEXPR inline QFlags<Flags::enum_type> operator|(Flags::enum_type f1, QFlags<Flags::enum_type> f2) \
^
/Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Headers/qsizepolicy.h:44:24: note: 'QSizePolicy' declared here
class Q_WIDGETS_EXPORT QSizePolicy
^
/Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Headers/qsizepolicy.h:158:31: error: 'QSizePolicy' is not a class, namespace, or scoped enumeration
Q_DECLARE_OPERATORS_FOR_FLAGS(QSizePolicy::ControlTypes)
^
/usr/local/include/QtCore/qglobal.h:2359:50: note: expanded from macro 'Q_DECLARE_OPERATORS_FOR_FLAGS'
{ return f2 | f1; } Q_DECLARE_INCOMPATIBLE_FLAGS(Flags)
^
/usr/local/include/QtCore/qglobal.h:2352:36: note: expanded from macro 'Q_DECLARE_INCOMPATIBLE_FLAGS'
inline QIncompatibleFlag operator|(Flags::enum_type f1, int f2) \
^
/Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Headers/qsizepolicy.h:44:24: note: 'QSizePolicy' declared here
class Q_WIDGETS_EXPORT QSizePolicy
^
/Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Headers/qsizepolicy.h:162:18: error: variable has incomplete type 'Q_WIDGETS_EXPORT'
Q_WIDGETS_EXPORT QDataStream &operator<<(QDataStream &, const QSizePolicy &);
^
/Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Headers/qsizepolicy.h:44:7: note: forward declaration of 'Q_WIDGETS_EXPORT'
class Q_WIDGETS_EXPORT QSizePolicy
^
/Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Headers/qsizepolicy.h:162:29: error: expected ';' after top level declarator
Q_WIDGETS_EXPORT QDataStream &operator<<(QDataStream &, const QSizePolicy &);
^
;
/Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Headers/qsizepolicy.h:163:18: error: redefinition of 'QDataStream'
Q_WIDGETS_EXPORT QDataStream &operator>>(QDataStream &, QSizePolicy &);
^
/Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Headers/qsizepolicy.h:162:18: note: previous definition is here
Q_WIDGETS_EXPORT QDataStream &operator<<(QDataStream &, const QSizePolicy &);
^
/Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Headers/qsizepolicy.h:163:29: error: expected ';' after top level declarator
Q_WIDGETS_EXPORT QDataStream &operator>>(QDataStream &, QSizePolicy &);
^
;
/Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Headers/qsizepolicy.h:167:18: error: variable has incomplete type 'Q_WIDGETS_EXPORT'
Q_WIDGETS_EXPORT QDebug operator<<(QDebug dbg, const QSizePolicy &);
^
/Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Headers/qsizepolicy.h:44:7: note: forward declaration of 'Q_WIDGETS_EXPORT'
class Q_WIDGETS_EXPORT QSizePolicy
^
/Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Headers/qsizepolicy.h:167:24: error: expected ';' after top level declarator
Q_WIDGETS_EXPORT QDebug operator<<(QDebug dbg, const QSizePolicy &);
^
;
/Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Headers/qsizepolicy.h:170:13: error: 'QSizePolicy' is not a class, namespace, or scoped enumeration
inline void QSizePolicy::transpose() {
^
/Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Headers/qsizepolicy.h:44:24: note: 'QSizePolicy' declared here
class Q_WIDGETS_EXPORT QSizePolicy
^
In file included from ../qt_wt_learn/main.cpp:1:
In file included from ../qt_wt_learn/MainWindow.h:4:
In file included from /Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Versions/5/Headers/QMainWindow:1:
In file included from /Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Versions/5/Headers/qmainwindow.h:37:
In file included from /Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Headers/qwidget.h:48:
/usr/local/include/QtGui/qcursor.h:171:14: error: must use 'class' tag to refer to type 'QDataStream' in this scope
Q_GUI_EXPORT QDataStream &operator<<(QDataStream &outS, const QCursor &cursor);
^
class
/Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Headers/qsizepolicy.h:162:18: note: class 'QDataStream' is hidden by a non-type declaration of 'QDataStream' here
Q_WIDGETS_EXPORT QDataStream &operator<<(QDataStream &, const QSizePolicy &);
^
In file included from ../qt_wt_learn/main.cpp:1:
In file included from ../qt_wt_learn/MainWindow.h:4:
In file included from /Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Versions/5/Headers/QMainWindow:1:
In file included from /Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Versions/5/Headers/qmainwindow.h:37:
In file included from /Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Headers/qwidget.h:48:
/usr/local/include/QtGui/qcursor.h:171:38: error: must use 'class' tag to refer to type 'QDataStream' in this scope
Q_GUI_EXPORT QDataStream &operator<<(QDataStream &outS, const QCursor &cursor);
^
class
/Applications/Qt5.4.1/5.4/clang_64/lib/QtWidgets.framework/Headers/qsizepolicy.h:162:18: note: class 'QDataStream' is hidden by a non-type declaration of 'QDataStream' here
Q_WIDGETS_EXPORT QDataStream &operator<<(QDataStream &, const QSizePolicy &);
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
5 warnings and 20 errors generated.
make: *** [main.o] Error 1
21:20:40: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project qt_wt_learn (kit: Desktop Qt 5.4.1 clang 64bit)

is like the signal/slot mechanism of Qt has conflict with Wt

how can I fix that ??

regards


Replies (1)

RE: Error using Qt 5.4.1 and Wt at the same time - Added by Wim Dumon almost 9 years ago

Hello,

Looks to me that the export functions of your Qt headers are incorrectly configured. Typically this is done by some defines that you're expected to set when compiling, which has nothing to do with Wt.

I don't think that there is any incompatibility between Wt and Qt signals when Wt uses the boost::signals2 library, which is the default for recent boost versions.

BR,

Wim.

    (1-1/1)