I am using VC++ 2010 and Polyvox to do my project. before adding MeshDecimator class, everything is OK. After including the .h file and to do the mesh decimating thing, Linking errors occur as below:
Code:
1>CarvingMainLoop.obj : error LNK2005: "private: void __thiscall PolyVox::MeshDecimator<class PolyVox::PositionMaterial>::fillInitialVertexMetadata(class std::vector<struct PolyVox::MeshDecimator<class PolyVox::PositionMaterial>::InitialVertexMetadata,class std::allocator<struct PolyVox::MeshDecimator<class PolyVox::PositionMaterial>::InitialVertexMetadata> > &)" (?fillInitialVertexMetadata@?$MeshDecimator@VPositionMaterial@PolyVox@@@PolyVox@@AAEXAAV?$vector@UInitialVertexMetadata@?$MeshDecimator@VPositionMaterial@PolyVox@@@PolyVox@@V?$allocator@UInitialVertexMetadata@?$MeshDecimator@VPositionMaterial@PolyVox@@@PolyVox@@@std@@@std@@@Z) already defined in CarvingFrameListener.obj
1>CarvingMainLoop.obj : error LNK2005: "private: void __thiscall PolyVox::MeshDecimator<class PolyVox::PositionMaterialNormal>::fillInitialVertexMetadata(class std::vector<struct PolyVox::MeshDecimator<class PolyVox::PositionMaterialNormal>::InitialVertexMetadata,class std::allocator<struct PolyVox::MeshDecimator<class PolyVox::PositionMaterialNormal>::InitialVertexMetadata> > &)" (?fillInitialVertexMetadata@?$MeshDecimator@VPositionMaterialNormal@PolyVox@@@PolyVox@@AAEXAAV?$vector@UInitialVertexMetadata@?$MeshDecimator@VPositionMaterialNormal@PolyVox@@@PolyVox@@V?$allocator@UInitialVertexMetadata@?$MeshDecimator@VPositionMaterialNormal@PolyVox@@@PolyVox@@@std@@@std@@@Z) already defined in CarvingFrameListener.obj
1>CarvingMainLoop.obj : error LNK2005: "private: bool __thiscall PolyVox::MeshDecimator<class PolyVox::PositionMaterialNormal>::canCollapseNormalEdge(unsigned int,unsigned int)" (?canCollapseNormalEdge@?$MeshDecimator@VPositionMaterialNormal@PolyVox@@@PolyVox@@AAE_NII@Z) already defined in CarvingFrameListener.obj
1>CarvingMainLoop.obj : error LNK2005: "private: bool __thiscall PolyVox::MeshDecimator<class PolyVox::PositionMaterial>::canCollapseNormalEdge(unsigned int,unsigned int)" (?canCollapseNormalEdge@?$MeshDecimator@VPositionMaterial@PolyVox@@@PolyVox@@AAE_NII@Z) already defined in CarvingFrameListener.obj
1>main.obj : error LNK2005: "private: void __thiscall PolyVox::MeshDecimator<class PolyVox::PositionMaterial>::fillInitialVertexMetadata(class std::vector<struct PolyVox::MeshDecimator<class PolyVox::PositionMaterial>::InitialVertexMetadata,class std::allocator<struct PolyVox::MeshDecimator<class PolyVox::PositionMaterial>::InitialVertexMetadata> > &)" (?fillInitialVertexMetadata@?$MeshDecimator@VPositionMaterial@PolyVox@@@PolyVox@@AAEXAAV?$vector@UInitialVertexMetadata@?$MeshDecimator@VPositionMaterial@PolyVox@@@PolyVox@@V?$allocator@UInitialVertexMetadata@?$MeshDecimator@VPositionMaterial@PolyVox@@@PolyVox@@@std@@@std@@@Z) already defined in CarvingFrameListener.obj
1>main.obj : error LNK2005: "private: void __thiscall PolyVox::MeshDecimator<class PolyVox::PositionMaterialNormal>::fillInitialVertexMetadata(class std::vector<struct PolyVox::MeshDecimator<class PolyVox::PositionMaterialNormal>::InitialVertexMetadata,class std::allocator<struct PolyVox::MeshDecimator<class PolyVox::PositionMaterialNormal>::InitialVertexMetadata> > &)" (?fillInitialVertexMetadata@?$MeshDecimator@VPositionMaterialNormal@PolyVox@@@PolyVox@@AAEXAAV?$vector@UInitialVertexMetadata@?$MeshDecimator@VPositionMaterialNormal@PolyVox@@@PolyVox@@V?$allocator@UInitialVertexMetadata@?$MeshDecimator@VPositionMaterialNormal@PolyVox@@@PolyVox@@@std@@@std@@@Z) already defined in CarvingFrameListener.obj
1>main.obj : error LNK2005: "private: bool __thiscall PolyVox::MeshDecimator<class PolyVox::PositionMaterialNormal>::canCollapseNormalEdge(unsigned int,unsigned int)" (?canCollapseNormalEdge@?$MeshDecimator@VPositionMaterialNormal@PolyVox@@@PolyVox@@AAE_NII@Z) already defined in CarvingFrameListener.obj
1>main.obj : error LNK2005: "private: bool __thiscall PolyVox::MeshDecimator<class PolyVox::PositionMaterial>::canCollapseNormalEdge(unsigned int,unsigned int)" (?canCollapseNormalEdge@?$MeshDecimator@VPositionMaterial@PolyVox@@@PolyVox@@AAE_NII@Z) already defined in CarvingFrameListener.obj
1>VolumeStone.obj : error LNK2005: "private: void __thiscall PolyVox::MeshDecimator<class PolyVox::PositionMaterial>::fillInitialVertexMetadata(class std::vector<struct PolyVox::MeshDecimator<class PolyVox::PositionMaterial>::InitialVertexMetadata,class std::allocator<struct PolyVox::MeshDecimator<class PolyVox::PositionMaterial>::InitialVertexMetadata> > &)" (?fillInitialVertexMetadata@?$MeshDecimator@VPositionMaterial@PolyVox@@@PolyVox@@AAEXAAV?$vector@UInitialVertexMetadata@?$MeshDecimator@VPositionMaterial@PolyVox@@@PolyVox@@V?$allocator@UInitialVertexMetadata@?$MeshDecimator@VPositionMaterial@PolyVox@@@PolyVox@@@std@@@std@@@Z) already defined in CarvingFrameListener.obj
1>VolumeStone.obj : error LNK2005: "private: void __thiscall PolyVox::MeshDecimator<class PolyVox::PositionMaterialNormal>::fillInitialVertexMetadata(class std::vector<struct PolyVox::MeshDecimator<class PolyVox::PositionMaterialNormal>::InitialVertexMetadata,class std::allocator<struct PolyVox::MeshDecimator<class PolyVox::PositionMaterialNormal>::InitialVertexMetadata> > &)" (?fillInitialVertexMetadata@?$MeshDecimator@VPositionMaterialNormal@PolyVox@@@PolyVox@@AAEXAAV?$vector@UInitialVertexMetadata@?$MeshDecimator@VPositionMaterialNormal@PolyVox@@@PolyVox@@V?$allocator@UInitialVertexMetadata@?$MeshDecimator@VPositionMaterialNormal@PolyVox@@@PolyVox@@@std@@@std@@@Z) already defined in CarvingFrameListener.obj
1>VolumeStone.obj : error LNK2005: "private: bool __thiscall PolyVox::MeshDecimator<class PolyVox::PositionMaterialNormal>::canCollapseNormalEdge(unsigned int,unsigned int)" (?canCollapseNormalEdge@?$MeshDecimator@VPositionMaterialNormal@PolyVox@@@PolyVox@@AAE_NII@Z) already defined in CarvingFrameListener.obj
1>VolumeStone.obj : error LNK2005: "private: bool __thiscall PolyVox::MeshDecimator<class PolyVox::PositionMaterial>::canCollapseNormalEdge(unsigned int,unsigned int)" (?canCollapseNormalEdge@?$MeshDecimator@VPositionMaterial@PolyVox@@@PolyVox@@AAE_NII@Z) already defined in CarvingFrameListener.obj
1>bin\Debug\\Carving.exe : fatal error LNK1169: one or more multiply defined symbols found
how to solve the problem? it has been bothering me for almost a day!