Hello,
I'm new to polyvox, and i'm trying to display the basic sphere. But i've got linking error when trying to compile.
I use VS2010 for both and i get this errors :
Code:
Error 14 error LNK1120: 13 unresolved externals F:\OgreExperiment\proto\OgreApp3\OgreApp3\bin\Debug\\OgreApp3.exe OgreApp3
Error 13 error LNK2019: unresolved external symbol "bool __cdecl PolyVox::isPowerOf2(unsigned int)" (?isPowerOf2@PolyVox@@YA_NI@Z) referenced in function "public: void __thiscall PolyVox::SimpleVolume<class PolyVox::MaterialDensityPair<unsigned char,4,4> >::resize(class PolyVox::Region const &,unsigned short)" (?resize@?$SimpleVolume@V?$MaterialDensityPair@E$03$03@PolyVox@@@PolyVox@@QAEXABVRegion@2@G@Z) F:\OgreExperiment\proto\OgreApp3\OgreApp3\OgreApp3.obj OgreApp3
Error 3 error LNK2019: unresolved external symbol "private: void __thiscall OgreApp3::createSphereInVolume(class PolyVox::SimpleVolume<class PolyVox::MaterialDensityPair<unsigned char,4,4> > &,float)" (?createSphereInVolume@OgreApp3@@AAEXAAV?$SimpleVolume@V?$MaterialDensityPair@E$03$03@PolyVox@@@PolyVox@@M@Z) referenced in function "protected: virtual void __thiscall OgreApp3::createScene(void)" (?createScene@OgreApp3@@MAEXXZ) F:\OgreExperiment\proto\OgreApp3\OgreApp3\OgreApp3.obj OgreApp3
Error 9 error LNK2019: unresolved external symbol "public: __thiscall PolyVox::PositionMaterialNormal::PositionMaterialNormal(class PolyVox::Vector<3,float>,class PolyVox::Vector<3,float>,float)" (??0PositionMaterialNormal@PolyVox@@QAE@V?$Vector@$02M@1@0M@Z) referenced in function "public: void __thiscall PolyVox::CubicSurfaceExtractorWithNormals<class PolyVox::SimpleVolume,class PolyVox::MaterialDensityPair<unsigned char,4,4> >::execute(void)" (?execute@?$CubicSurfaceExtractorWithNormals@VSimpleVolume@PolyVox@@V?$MaterialDensityPair@E$03$03@2@@PolyVox@@QAEXXZ) F:\OgreExperiment\proto\OgreApp3\OgreApp3\OgreApp3.obj OgreApp3
Error 4 error LNK2019: unresolved external symbol "public: __thiscall PolyVox::Region::Region(class PolyVox::Vector<3,int> const &,class PolyVox::Vector<3,int> const &)" (??0Region@PolyVox@@QAE@ABV?$Vector@$02H@1@0@Z) referenced in function "protected: virtual void __thiscall OgreApp3::createScene(void)" (?createScene@OgreApp3@@MAEXXZ) F:\OgreExperiment\proto\OgreApp3\OgreApp3\OgreApp3.obj OgreApp3
Error 7 error LNK2019: unresolved external symbol "public: __thiscall PolyVox::Region::Region(void)" (??0Region@PolyVox@@QAE@XZ) referenced in function "public: __thiscall PolyVox::SimpleVolume<class PolyVox::MaterialDensityPair<unsigned char,4,4> >::SimpleVolume<class PolyVox::MaterialDensityPair<unsigned char,4,4> >(class PolyVox::Region const &,unsigned short)" (??0?$SimpleVolume@V?$MaterialDensityPair@E$03$03@PolyVox@@@PolyVox@@QAE@ABVRegion@1@G@Z) F:\OgreExperiment\proto\OgreApp3\OgreApp3\OgreApp3.obj OgreApp3
Error 8 error LNK2019: unresolved external symbol "public: bool __thiscall PolyVox::Region::containsPoint(class PolyVox::Vector<3,int> const &,unsigned char)const " (?containsPoint@Region@PolyVox@@QBE_NABV?$Vector@$02H@2@E@Z) referenced in function "public: class PolyVox::MaterialDensityPair<unsigned char,4,4> __thiscall PolyVox::SimpleVolume<class PolyVox::MaterialDensityPair<unsigned char,4,4> >::getVoxelAt(int,int,int)const " (?getVoxelAt@?$SimpleVolume@V?$MaterialDensityPair@E$03$03@PolyVox@@@PolyVox@@QBE?AV?$MaterialDensityPair@E$03$03@2@HHH@Z) F:\OgreExperiment\proto\OgreApp3\OgreApp3\OgreApp3.obj OgreApp3
Error 1 error LNK2019: unresolved external symbol "public: class PolyVox::Vector<3,float> const & __thiscall PolyVox::PositionMaterialNormal::getNormal(void)const " (?getNormal@PositionMaterialNormal@PolyVox@@QBEABV?$Vector@$02M@2@XZ) referenced in function "protected: virtual void __thiscall OgreApp3::createScene(void)" (?createScene@OgreApp3@@MAEXXZ) F:\OgreExperiment\proto\OgreApp3\OgreApp3\OgreApp3.obj OgreApp3
Error 2 error LNK2019: unresolved external symbol "public: class PolyVox::Vector<3,float> const & __thiscall PolyVox::PositionMaterialNormal::getPosition(void)const " (?getPosition@PositionMaterialNormal@PolyVox@@QBEABV?$Vector@$02M@2@XZ) referenced in function "protected: virtual void __thiscall OgreApp3::createScene(void)" (?createScene@OgreApp3@@MAEXXZ) F:\OgreExperiment\proto\OgreApp3\OgreApp3\OgreApp3.obj OgreApp3
Error 5 error LNK2019: unresolved external symbol "public: class PolyVox::Vector<3,int> const & __thiscall PolyVox::Region::getLowerCorner(void)const " (?getLowerCorner@Region@PolyVox@@QBEABV?$Vector@$02H@2@XZ) referenced in function "public: int __thiscall PolyVox::BaseVolume<class PolyVox::MaterialDensityPair<unsigned char,4,4> >::getWidth(void)const " (?getWidth@?$BaseVolume@V?$MaterialDensityPair@E$03$03@PolyVox@@@PolyVox@@QBEHXZ) F:\OgreExperiment\proto\OgreApp3\OgreApp3\OgreApp3.obj OgreApp3
Error 6 error LNK2019: unresolved external symbol "public: class PolyVox::Vector<3,int> const & __thiscall PolyVox::Region::getUpperCorner(void)const " (?getUpperCorner@Region@PolyVox@@QBEABV?$Vector@$02H@2@XZ) referenced in function "public: int __thiscall PolyVox::BaseVolume<class PolyVox::MaterialDensityPair<unsigned char,4,4> >::getWidth(void)const " (?getWidth@?$BaseVolume@V?$MaterialDensityPair@E$03$03@PolyVox@@@PolyVox@@QBEHXZ) F:\OgreExperiment\proto\OgreApp3\OgreApp3\OgreApp3.obj OgreApp3
Error 12 error LNK2019: unresolved external symbol "public: void __thiscall PolyVox::Region::setLowerCorner(class PolyVox::Vector<3,int> const &)" (?setLowerCorner@Region@PolyVox@@QAEXABV?$Vector@$02H@2@@Z) referenced in function "public: void __thiscall PolyVox::SimpleVolume<class PolyVox::MaterialDensityPair<unsigned char,4,4> >::resize(class PolyVox::Region const &,unsigned short)" (?resize@?$SimpleVolume@V?$MaterialDensityPair@E$03$03@PolyVox@@@PolyVox@@QAEXABVRegion@2@G@Z) F:\OgreExperiment\proto\OgreApp3\OgreApp3\OgreApp3.obj OgreApp3
Error 11 error LNK2019: unresolved external symbol "public: void __thiscall PolyVox::Region::setUpperCorner(class PolyVox::Vector<3,int> const &)" (?setUpperCorner@Region@PolyVox@@QAEXABV?$Vector@$02H@2@@Z) referenced in function "public: void __thiscall PolyVox::SimpleVolume<class PolyVox::MaterialDensityPair<unsigned char,4,4> >::resize(class PolyVox::Region const &,unsigned short)" (?resize@?$SimpleVolume@V?$MaterialDensityPair@E$03$03@PolyVox@@@PolyVox@@QAEXABVRegion@2@G@Z) F:\OgreExperiment\proto\OgreApp3\OgreApp3\OgreApp3.obj OgreApp3
Error 10 error LNK2019: unresolved external symbol "unsigned char __cdecl PolyVox::logBase2(unsigned int)" (?logBase2@PolyVox@@YAEI@Z) referenced in function "public: void __thiscall PolyVox::SimpleVolume<class PolyVox::MaterialDensityPair<unsigned char,4,4> >::resize(class PolyVox::Region const &,unsigned short)" (?resize@?$SimpleVolume@V?$MaterialDensityPair@E$03$03@PolyVox@@@PolyVox@@QAEXABVRegion@2@G@Z) F:\OgreExperiment\proto\OgreApp3\OgreApp3\OgreApp3.obj OgreApp3
i use the basic application code from ogre3D and here is my createscene function :
Code:
PolyVox::SimpleVolume<PolyVox::MaterialDensityPair44> volData(PolyVox::Region(PolyVox::Vector3DInt32(0,0,0), PolyVox::Vector3DInt32(63, 63, 63)));
createSphereInVolume(volData, 30);
PolyVox::SurfaceMesh<PolyVox::PositionMaterialNormal> mesh;
PolyVox::CubicSurfaceExtractorWithNormals<PolyVox::SimpleVolume, PolyVox::MaterialDensityPair44 > surfaceExtractor(&volData, volData.getEnclosingRegion(), &mesh);
surfaceExtractor.execute();
Ogre::ManualObject* ogremesh;
ogremesh = mSceneMgr->createManualObject("Polyvox Mesh");
ogremesh->setDynamic(true);
ogremesh->begin("BaseWhiteNoLighting", Ogre::RenderOperation::OT_TRIANGLE_LIST);
ogremesh->end();
Ogre::SceneNode* ogreNode = mSceneMgr->getRootSceneNode()->createChildSceneNode("testnode1", Ogre::Vector3(20, 0, 0));
ogreNode->attachObject(ogremesh);
ogremesh->beginUpdate(0);
{
const std::vector<uint32_t>& vecIndices = mesh.getIndices();
const std::vector<PolyVox::PositionMaterialNormal>& vecVertices = mesh.getVertices();
for (std::vector<PolyVox::PositionMaterialNormal>::const_iterator itVertex = vecVertices.begin(); itVertex != vecVertices.end(); ++itVertex)
{
const PolyVox::PositionMaterialNormal& vertex = *itVertex;
const PolyVox::Vector3DFloat& vertPos = vertex.getPosition();
ogremesh->position(vertPos.getX(), vertPos.getY(), vertPos.getZ());
ogremesh->normal(vertex.getNormal().getX(), vertex.getNormal().getY(), vertex.getNormal().getZ());
}
for (std::vector<uint32_t>::const_iterator itIdx = vecIndices.begin(); itIdx != vecIndices.end(); ++itIdx)
{
ogremesh->index(*itIdx);
}
}
ogremesh->end();
Did you have any suggestions ?
thanks.