Volumes Of Fun
http://www.volumesoffun.com/phpBB3/

Getting polyvox working in visual studio 2010
http://www.volumesoffun.com/phpBB3/viewtopic.php?f=14&t=596
Page 1 of 2

Author:  StenrReisa [ Sun Jul 06, 2014 3:12 am ]
Post subject:  Getting polyvox working in visual studio 2010

I am trying to get polyvox to work in visual studio 2010, but I keep getting a bunch of linker errors. I can use code from the examples in my project and everything, just when I go to compile I get several linker errors. I feel like i have not linked the libraries correctly, but I am not sure. Any help is appreciated.

Author:  David Williams [ Sun Jul 06, 2014 5:16 am ]
Post subject:  Re: Getting polyvox working in visual studio 2010

You are going to need to give some more details, such as the specific errors which are given. Also, which version of PolyVox are you using? The 0.2.1 release should work on VS 2010 but the latest develop branch requires VS 2012.

Author:  StenrReisa [ Sun Jul 06, 2014 6:05 am ]
Post subject:  Re: Getting polyvox working in visual studio 2010

Code:
1>GameState.obj : 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 "public: void __thiscall GameState::createScene(void)" (?createScene@GameState@@QAEXXZ)
1>GameState.obj : error LNK2019: unresolved external symbol "public: __thiscall PolyVox::Region::Region(void)" (??0Region@PolyVox@@QAE@XZ) referenced in function "public: __thiscall PolyVox::SimpleVolume<unsigned char>::SimpleVolume<unsigned char>(class PolyVox::Region const &,unsigned short)" (??0?$SimpleVolume@E@PolyVox@@QAE@ABVRegion@1@G@Z)
1>GameState.obj : error LNK2019: unresolved external symbol "unsigned char __cdecl PolyVox::logBase2(unsigned int)" (?logBase2@PolyVox@@YAEI@Z) referenced in function "private: void __thiscall PolyVox::SimpleVolume<unsigned char>::initialise(class PolyVox::Region const &,unsigned short)" (?initialise@?$SimpleVolume@E@PolyVox@@AAEXABVRegion@2@G@Z)
1>GameState.obj : 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 "private: void __thiscall PolyVox::SimpleVolume<unsigned char>::initialise(class PolyVox::Region const &,unsigned short)" (?initialise@?$SimpleVolume@E@PolyVox@@AAEXABVRegion@2@G@Z)
1>GameState.obj : 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 "private: void __thiscall PolyVox::SimpleVolume<unsigned char>::initialise(class PolyVox::Region const &,unsigned short)" (?initialise@?$SimpleVolume@E@PolyVox@@AAEXABVRegion@2@G@Z)
1>GameState.obj : 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 "private: void __thiscall PolyVox::SimpleVolume<unsigned char>::initialise(class PolyVox::Region const &,unsigned short)" (?initialise@?$SimpleVolume@E@PolyVox@@AAEXABVRegion@2@G@Z)
1>GameState.obj : 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 "private: void __thiscall PolyVox::SimpleVolume<unsigned char>::initialise(class PolyVox::Region const &,unsigned short)" (?initialise@?$SimpleVolume@E@PolyVox@@AAEXABVRegion@2@G@Z)
1>GameState.obj : error LNK2019: unresolved external symbol "bool __cdecl PolyVox::isPowerOf2(unsigned int)" (?isPowerOf2@PolyVox@@YA_NI@Z) referenced in function "private: void __thiscall PolyVox::SimpleVolume<unsigned char>::initialise(class PolyVox::Region const &,unsigned short)" (?initialise@?$SimpleVolume@E@PolyVox@@AAEXABVRegion@2@G@Z)


Here are the errors i get. I am using the older version so it shouldnt be that. Thanks for the help.

Author:  David Williams [ Sun Jul 06, 2014 11:23 am ]
Post subject:  Re: Getting polyvox working in visual studio 2010

Ok, and how have you set up the linking process? It is a manually created Visual Studio project or one generated from CMake (for example)? Which libraries are you linking against and are they being found?

From the error it looks like you just haven't told it to link against PolyVoxCore.lib.

Author:  StenrReisa [ Sun Jul 06, 2014 8:01 pm ]
Post subject:  Re: Getting polyvox working in visual studio 2010

Its a manually created vs project, I am not sure how to tell it to link against PolyVoxCore.lib. I tried adding it to additional dependencies under input (under linker) under project properties but it couldn't find the file.

Author:  Rippie [ Mon Jul 07, 2014 7:22 am ]
Post subject:  Re: Getting polyvox working in visual studio 2010

StenrReisa wrote:
Its a manually created vs project, I am not sure how to tell it to link against PolyVoxCore.lib. I tried adding it to additional dependencies under input (under linker) under project properties but it couldn't find the file.

You indeed need the library set up under Linker for it to work.
First add the directory in which the library resides under Linker->General->Additional Library Directories (so that VS knows where to look).
Second, add the filename to Linker->Input->Additional Dependencies.

Author:  StenrReisa [ Mon Jul 07, 2014 10:58 pm ]
Post subject:  Re: Getting polyvox working in visual studio 2010

Where is the .lib file located? The only one I could find was in build\library\PolyVoxCore\Debug and I had already linked it like you said and it still says it can't find it.

Author:  David Williams [ Tue Jul 08, 2014 7:36 am ]
Post subject:  Re: Getting polyvox working in visual studio 2010

StenrReisa wrote:
The only one I could find was in build\library\PolyVoxCore\Debug and I had already linked it like you said and it still says it can't find it.


Yes, this is correct (for debug builds). In 'Additional Dependencies' you can actually specify the full path to the library if you wish - something like 'C:\path\goes\here\PolyVoxCore.lib'. Then it should definitely be found if it exists.

Author:  StenrReisa [ Wed Jul 09, 2014 6:07 am ]
Post subject:  Re: Getting polyvox working in visual studio 2010

OK i figured it out, there was no polyvoxcore.lib in the directory i was linking, I copied it from somewhere else and it worked. Thanks for the help!

Author:  StenrReisa [ Sun Jul 20, 2014 5:15 am ]
Post subject:  Re: Getting polyvox working in visual studio 2010

Now I am just trying to get a basic example set up, following the code from https://bitbucket.org/volumesoffun/polyvox/wiki/Building%20PolyVox%20with%20CodeBlocks%20MinGW%20and%20Ogre3D here. I am using Ogre3d.
Here is the code:
Code:
    SimpleVolume<uint8_t> volData(PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(63, 63, 63)));
    createSphereInVolume(volData, 30);

    SurfaceMesh<PositionMaterialNormal> mesh;

    //MarchingCubesSurfaceExtractor< SimpleVolume<uint8_t> > surfaceExtractor(&volData, volData.getEnclosingRegion(), &mesh);
    CubicSurfaceExtractorWithNormals< SimpleVolume<uint8_t> > surfaceExtractor(&volData, volData.getEnclosingRegion(), &mesh);

    surfaceExtractor.execute();
    cerr << mesh.getNoOfIndices() << ' ' << mesh.getNoOfVertices() << endl;

    // Set the scene's ambient light
    mSceneMgr->setAmbientLight(Ogre::ColourValue(0.5f, 0.5f, 0.5f));

    //Create a ManualObject
    Ogre::ManualObject* manual = mSceneMgr->createManualObject("manual");

    //Begin a section of the ManualObject (we're only using one section)
    manual->begin("BaseWhiteNoLighting", Ogre::RenderOperation::OT_TRIANGLE_LIST);

    //Iterate through all the vertices in the mesh produced by the surface extractor
    //and add them to the ManualObject section.
    for(vector<PositionMaterialNormal>::const_iterator it = mesh.getVertices().begin(); it != mesh.getVertices().end(); ++it)
    {
        const Vector3DFloat& vertexPos = it->getPosition();
        const Vector3DFloat& vertexNorm = it->getNormal();
        manual->position(vertexPos.getX(),vertexPos.getY(),vertexPos.getZ());
        manual->normal(vertexNorm.getX(),vertexNorm.getY(),vertexNorm.getZ());
        manual->colour(abs(vertexNorm.getX()),abs(vertexNorm.getY()),abs(vertexNorm.getZ()));
    }

    //Now we iterate through all the indices from the mesh and also add them to the ManualObject section
    for(vector<uint32_t>::const_iterator it = mesh.getIndices().begin(); it != mesh.getIndices().end(); ++it)
    {
        manual->index(*it);
    }

    //End the section then add the ManualObject to the scenegraph
    manual->end();
    mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(manual);

    // Create a Light and set its position
    Ogre::Light* light = mSceneMgr->createLight("MainLight");
    light->setPosition(20.0f, 80.0f, 50.0f);

and here are the error messages I get:
Code:
1>c:\users\blake\basics\finite\projects\development\client\finite\finite\gamestate.cpp(193): error C2440: 'initializing' : cannot convert from 'std::_Vector_const_iterator<_Myvec>' to 'std::_Vector_const_iterator<_Myvec>'
1>          with
1>          [
1>              _Myvec=std::_Vector_val<PolyVox::PositionMaterialNormal,std::allocator<PolyVox::PositionMaterialNormal>>
1>          ]
1>          and
1>          [
1>              _Myvec=std::_Vector_val<PolyVox::PositionMaterialNormal,Ogre::STLAllocator<PolyVox::PositionMaterialNormal,Ogre::GeneralAllocPolicy>>
1>          ]
1>          No constructor could take the source type, or constructor overload resolution was ambiguous
1>c:\users\blake\basics\finite\projects\development\client\finite\finite\gamestate.cpp(193): error C2678: binary '!=' : no operator found which takes a left-hand operand of type 'std::_Vector_const_iterator<_Myvec>' (or there is no acceptable conversion)
1>          with
1>          [
1>              _Myvec=std::_Vector_val<PolyVox::PositionMaterialNormal,Ogre::STLAllocator<PolyVox::PositionMaterialNormal,Ogre::GeneralAllocPolicy>>
1>          ]
1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\system_error(425): could be 'bool std::operator !=(const std::error_code &,const std::error_condition &)' [found using argument-dependent lookup]
1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\system_error(432): or       'bool std::operator !=(const std::error_condition &,const std::error_code &)' [found using argument-dependent lookup]
1>          c:\users\blake\basics\finite\libraries\ogresdk_vc10_v1-8-0\include\ogre\ogreutfstring.h(335): or       'bool Ogre::operator !=(const Ogre::UTFString::_const_fwd_iterator &,const Ogre::UTFString::_const_fwd_iterator &)'
1>          c:\users\blake\basics\finite\libraries\ogresdk_vc10_v1-8-0\include\ogre\ogreutfstring.h(422): or       'bool Ogre::operator !=(const Ogre::UTFString::_const_rev_iterator &,const Ogre::UTFString::_const_rev_iterator &)'
1>          c:\users\blake\basics\finite\libraries\ogresdk_vc10_v1-8-0\include\ogre\ogreshadowtexturemanager.h(68): or       'bool Ogre::operator !=(const Ogre::ShadowTextureConfig &,const Ogre::ShadowTextureConfig &)'
1>          c:\program files (x86)\microsoft sdks\windows\v7.0a\include\guiddef.h(197): or       'int operator !=(const GUID &,const GUID &)'
1>          c:\program files (x86)\microsoft sdks\windows\v7.0a\include\propkeydef.h(33): or       'int operator !=(const PROPERTYKEY &,const PROPERTYKEY &)'
1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector(206): or       'bool std::_Vector_const_iterator<_Myvec>::operator !=(const std::_Vector_const_iterator<_Myvec> &) const'
1>          with
1>          [
1>              _Myvec=std::_Vector_val<PolyVox::PositionMaterialNormal,Ogre::STLAllocator<PolyVox::PositionMaterialNormal,Ogre::GeneralAllocPolicy>>
1>          ]
1>          while trying to match the argument list '(std::_Vector_const_iterator<_Myvec>, std::_Vector_const_iterator<_Myvec>)'
1>          with
1>          [
1>              _Myvec=std::_Vector_val<PolyVox::PositionMaterialNormal,Ogre::STLAllocator<PolyVox::PositionMaterialNormal,Ogre::GeneralAllocPolicy>>
1>          ]
1>          and
1>          [
1>              _Myvec=std::_Vector_val<PolyVox::PositionMaterialNormal,std::allocator<PolyVox::PositionMaterialNormal>>
1>          ]
1>c:\users\blake\basics\finite\projects\development\client\finite\finite\gamestate.cpp(203): error C2440: 'initializing' : cannot convert from 'std::_Vector_const_iterator<_Myvec>' to 'std::_Vector_const_iterator<_Myvec>'
1>          with
1>          [
1>              _Myvec=std::_Vector_val<uint32_t,std::allocator<char32_t>>
1>          ]
1>          and
1>          [
1>              _Myvec=std::_Vector_val<size_t,Ogre::STLAllocator<size_t,Ogre::GeneralAllocPolicy>>
1>          ]
1>          No constructor could take the source type, or constructor overload resolution was ambiguous
1>c:\users\blake\basics\finite\projects\development\client\finite\finite\gamestate.cpp(203): error C2678: binary '!=' : no operator found which takes a left-hand operand of type 'std::_Vector_const_iterator<_Myvec>' (or there is no acceptable conversion)
1>          with
1>          [
1>              _Myvec=std::_Vector_val<size_t,Ogre::STLAllocator<size_t,Ogre::GeneralAllocPolicy>>
1>          ]
1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\system_error(425): could be 'bool std::operator !=(const std::error_code &,const std::error_condition &)' [found using argument-dependent lookup]
1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\system_error(432): or       'bool std::operator !=(const std::error_condition &,const std::error_code &)' [found using argument-dependent lookup]
1>          c:\users\blake\basics\finite\libraries\ogresdk_vc10_v1-8-0\include\ogre\ogreutfstring.h(335): or       'bool Ogre::operator !=(const Ogre::UTFString::_const_fwd_iterator &,const Ogre::UTFString::_const_fwd_iterator &)'
1>          c:\users\blake\basics\finite\libraries\ogresdk_vc10_v1-8-0\include\ogre\ogreutfstring.h(422): or       'bool Ogre::operator !=(const Ogre::UTFString::_const_rev_iterator &,const Ogre::UTFString::_const_rev_iterator &)'
1>          c:\users\blake\basics\finite\libraries\ogresdk_vc10_v1-8-0\include\ogre\ogreshadowtexturemanager.h(68): or       'bool Ogre::operator !=(const Ogre::ShadowTextureConfig &,const Ogre::ShadowTextureConfig &)'
1>          c:\program files (x86)\microsoft sdks\windows\v7.0a\include\guiddef.h(197): or       'int operator !=(const GUID &,const GUID &)'
1>          c:\program files (x86)\microsoft sdks\windows\v7.0a\include\propkeydef.h(33): or       'int operator !=(const PROPERTYKEY &,const PROPERTYKEY &)'
1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector(206): or       'bool std::_Vector_const_iterator<_Myvec>::operator !=(const std::_Vector_const_iterator<_Myvec> &) const'
1>          with
1>          [
1>              _Myvec=std::_Vector_val<size_t,Ogre::STLAllocator<size_t,Ogre::GeneralAllocPolicy>>
1>          ]
1>          while trying to match the argument list '(std::_Vector_const_iterator<_Myvec>, std::_Vector_const_iterator<_Myvec>)'
1>          with
1>          [
1>              _Myvec=std::_Vector_val<size_t,Ogre::STLAllocator<size_t,Ogre::GeneralAllocPolicy>>
1>          ]
1>          and
1>          [
1>              _Myvec=std::_Vector_val<uint32_t,std::allocator<char32_t>>
1>          ]


Any ideas?

Page 1 of 2 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/