PDA

View Full Version : Strange linker errors with QVector



bmueller63
16th February 2011, 22:24
I try to use Qt with VS2010. I got 2 projects, one is fine, the other gets these errors:
(sorry - I am using a german system)

I alredy tried to instanciate QVector<QPointF> but this does not solve the problem.

FixturePolygon.cpp.obj : error LNK2019: Verweis auf nicht aufgel÷stes externes Symbol ""__declspec(dllimport) public: class QVector<class QPointF>::const_iterator __thiscall QVector<class QPointF>::end(void)const " (__imp_?end@?$QVector@VQPointF@@@@QBE?AVconst_iter ator@1@XZ)" in Funktion ""public: __thiscall QForeachContainer<class GPolygonF>::QForeachContainer<class GPolygonF>(class GPolygonF const &)" (??0?$QForeachContainer@VGPolygonF@@@@QAE@ABVGPoly gonF@@@Z)".
main.cpp.obj : error LNK2001: Nicht aufgel÷stes externes Symbol ""__declspec(dllimport) public: class QVector<class QPointF>::const_iterator __thiscall QVector<class QPointF>::end(void)const " (__imp_?end@?$QVector@VQPointF@@@@QBE?AVconst_iter ator@1@XZ)".
Polygon.cpp.obj : error LNK2001: Nicht aufgel÷stes externes Symbol ""__declspec(dllimport) public: class QVector<class QPointF>::const_iterator __thiscall QVector<class QPointF>::end(void)const " (__imp_?end@?$QVector@VQPointF@@@@QBE?AVconst_iter ator@1@XZ)".
FixturePolygon.cpp.obj : error LNK2019: Verweis auf nicht aufgel÷stes externes Symbol ""__declspec(dllimport) public: class QVector<class QPointF>::const_iterator __thiscall QVector<class QPointF>::begin(void)const " (__imp_?begin@?$QVector@VQPointF@@@@QBE?AVconst_it erator@1@XZ)" in Funktion ""public: __thiscall QForeachContainer<class GPolygonF>::QForeachContainer<class GPolygonF>(class GPolygonF const &)" (??0?$QForeachContainer@VGPolygonF@@@@QAE@ABVGPoly gonF@@@Z)".
main.cpp.obj : error LNK2001: Nicht aufgel÷stes externes Symbol ""__declspec(dllimport) public: class QVector<class QPointF>::const_iterator __thiscall QVector<class QPointF>::begin(void)const " (__imp_?begin@?$QVector@VQPointF@@@@QBE?AVconst_it erator@1@XZ)".
Polygon.cpp.obj : error LNK2001: Nicht aufgel÷stes externes Symbol ""__declspec(dllimport) public: class QVector<class QPointF>::const_iterator __thiscall QVector<class QPointF>::begin(void)const " (__imp_?begin@?$QVector@VQPointF@@@@QBE?AVconst_it erator@1@XZ)".
PhysicsEditor.exe : fatal error LNK1120: 2 nicht aufgel÷ste externe Verweise.
LINK failed. with 2

bmueller63
17th February 2011, 12:15
I created a small test project - same problem.

This seems to be the bug:
Qt defines QVector<QPointF> as external in QVector if the compiler is VC.
But somehow forgets to put the classes into the library.

MarekR22
17th February 2011, 12:39
Qt defines QVector<QPointF> as external in QVector if the compiler is VC.
But somehow forgets to put the classes into the library.Where? Point a location.
Show code where you are using defining this QList.