2

When using the armcc4.1 to compiler my code, it reports following error:

"access/qnetworkrequest_p.h", line 94: Error: #2574: explicit specialization of class "QTypeInfo>" must precede its first use (at line 105 of "../../include/QtCore/../../src/corelib/tools/qlist.h") Q_DECLARE_TYPEINFO(QNetworkHeadersPrivate::RawHeaderPair, Q_MOVABLE_TYPE);

class QNetworkHeadersPrivate
{
public:
    typedef QPair<QByteArray, QByteArray> RawHeaderPair;
    typedef QList<RawHeaderPair> RawHeadersList;
...
};

Q_DECLARE_TYPEINFO(QNetworkHeadersPrivate::RawHeaderPair, Q_MOVABLE_TYPE);

But, is there a way to disable or bypass this error?

John Dibling
  • 99,718
  • 31
  • 186
  • 324
thincal
  • 63
  • 7

3 Answers3

2

Answer my question: finally it's fixed by removing the last line, it's because this declaration is redundant.

thincal
  • 63
  • 7
1

I would try to modify the inclusion order of the header files.

jxh
  • 69,070
  • 8
  • 110
  • 193
1

Dont do list operations before not having the element type declared movable. Define any member function body that does so after the macro.

Johannes Schaub - litb
  • 496,577
  • 130
  • 894
  • 1,212