尝试使用Visual Studio 2010和Qt5.2 / Qt3D在Win7下编译this project时, 我收到以下错误:
error LNK1169: one or more multiply defined symbols found C:\OculusQt3D\oculusqt3d\build\Debug\OculusQt3D.exe 1
error LNK2005: "public: __thiscall QArray<class QVector3D,8>::~QArray<class QVector3D,8>(void)" (??1?$QArray@VQVector3D@@$07@@QAE@XZ) already defined in mdstate.obj C:\OculusQt3D\oculusqt3d\build\Qt53Dd.lib(Qt53Dd.dll)
error LNK2005: "public: __thiscall QArray<class QVector3D,8>::QArray<class QVector3D,8>(void)" (??0?$QArray@VQVector3D@@$07@@QAE@XZ) already defined in Qt53Dd.lib(Qt53Dd.dll) C:\OculusQt3D\oculusqt3d\build\MULTIBILLBOARD_LIBRARY.lib(databundle.obj)
error LNK2005: "public: int __thiscall QArray<class QVector3D,8>::size(void)const " (?size@?$QArray@VQVector3D@@$07@@QBEHXZ) already defined in mdstate.obj C:\OculusQt3D\oculusqt3d\build\Qt53Dd.lib(Qt53Dd.dll)
上述文件为mdstate.h / mdstate.cpp和databundle.h / databundle.cpp以及qarray.h / qarray.cpp
谷歌搜索后,有很多可能来源于此错误,但我无法理解这种情况。
通常这是因为包含一个.cpp而不是一个标题,意外地包含一个文件多次,丢失包括警卫和类似的东西,这不是这里的情况。
那么,有人知道这里的问题是什么吗?