emqx / qmqtt

MQTT client for Qt
https://www.emqx.com
Other
686 stars 334 forks source link

Compile Error #52

Closed wutianzhizhitianwu closed 8 years ago

wutianzhizhitianwu commented 8 years ago

Compile Error as the picture shows

wutianzhizhitianwu commented 8 years ago

g++ -c -pipe -O2 -Wall -W -D_REENTRANT -fPIC -DQMQTT_LIBRARY -DQT_NO_DEBUG -DQT_NETWORK_LIB -DQT_CORE_LIB -I/usr/local/QT5/run/5.4/gcc/mkspecs/linux-g++ -I. -I/usr/local/QT5/run/5.4/gcc/include -I/usr/local/QT5/run/5.4/gcc/include/QtNetwork -I/usr/local/QT5/run/5.4/gcc/include/QtCore -I. -o qmqtt_routedmessage.o qmqtt_routedmessage.cpp In file included from /usr/local/QT5/run/5.4/gcc/include/QtCore/QHash:1:0, from qmqtt_routedmessage.h:36, from qmqttroutedmessage.cpp:33: /usr/local/QT5/run/5.4/gcc/include/QtCore/qhash.h:在‘QHashNode<QString, QString>’的实例化中: /usr/local/QT5/run/5.4/gcc/include/QtCore/qhash.h:545:5:自‘static void QHash<Key, T>::deleteNode2(QHashData::Node) [with Key = QString, T = QString]’实例化 /usr/local/QT5/run/5.4/gcc/include/QtCore/qhash.h:581:5:自‘void QHash<Key, T>::freeData(QHashData_) [with Key = QString, T = QString]’实例化 /usr/local/QT5/run/5.4/gcc/include/QtCore/qhash.h:302:44:自‘QHash<Key, T>::~QHash() [with Key = QString, T = QString]’实例化 qmqttroutedmessage.cpp:37:72:从此处实例化 /usr/local/QT5/run/5.4/gcc/include/QtCore/qhash.h:201:15: 错误: ‘QHashNode<Key, T>::key’类型不完全 /usr/local/QT5/run/5.4/gcc/include/QtCore/qglobal.h:648:7: 错误: ‘const struct QString’的前向声明 /usr/local/QT5/run/5.4/gcc/include/QtCore/qhash.h:202:7: 错误: ‘QHashNode<Key, T>::value’类型不完全 /usr/local/QT5/run/5.4/gcc/include/QtCore/qglobal.h:648:7: 错误: ‘struct QString’的前向声明 /usr/local/QT5/run/5.4/gcc/include/QtCore/qhash.h: 在静态成员函数‘static void QHash<Key, T>::duplicateNode(QHashData::Node, void_) [with Key = QString, T = QString]’中: /usr/local/QT5/run/5.4/gcc/include/QtCore/qhash.h:593:92:自‘void QHash<Key, T>::detach_helper() [with Key = QString, T = QString]’实例化 /usr/local/QT5/run/5.4/gcc/include/QtCore/qhash.h:323:51:自‘void QHash<Key, T>::detach() [with Key = QString, T = QString]’实例化 /usr/local/QT5/run/5.4/gcc/include/QtCore/qhash.h:301:93:自‘QHash<Key, T>::QHash(const QHash<Key, T>&) [with Key = QString, T = QString]’实例化 qmqtt_routedmessage.cpp:48:12:从此处实例化 /usr/local/QT5/run/5.4/gcc/include/QtCore/qhash.h:553:5: 错误: ‘QHash<QString, QString>::Node’没有名为‘key’的成员 /usr/local/QT5/run/5.4/gcc/include/QtCore/qhash.h:553:5: 错误: ‘QHash<QString, QString>::Node’没有名为‘value’的成员 make: *\ [qmqtt_routedmessage.o] 错误 1

wuming123057 commented 8 years ago
Qt5.4.2/5.4/gcc_64/include/QtCore/qhash.h:201: error: 'QHashNode<Key, T>::key' has incomplete type  const Key key;
Qt5.4.2/5.4/gcc_64/include/QtCore/qglobal.h:648: error: forward declaration of 'const class QString'
 class QString;

The compiled environment is Qt5.4.2. So I add #include<QString> in the qmqtt_routedmessage.h file.

I test this library under Qt5.5,no error.