NxOgreOGRE3D_Debug.lib crash

Cheriburo

13-11-2010 10:59:12

Hi everyone,

I've only recently started using Ogre and NxOgre but I encountered a problem building a project that uses Ogre and NxOgre.


1>Linking...
1>NxOgreOGRE3D_Debug.lib(OGRE3DRenderable.obj) : error LNK2001: unresolved external symbol "public: virtual class Ogre::VectorIterator<class std::vector<class Ogre::ShadowRenderable *,class std::allocator<class Ogre::ShadowRenderable *> > > __thiscall Ogre::MovableObject::getShadowVolumeRenderableIterator(enum Ogre::ShadowTechnique,class Ogre::Light const *,class Ogre::HardwareIndexBufferSharedPtr *,bool,float,unsigned long)" (?getShadowVolumeRenderableIterator@MovableObject@Ogre@@UAE?AV?$VectorIterator@V?$vector@PAVShadowRenderable@Ogre@@V?$allocator@PAVShadowRenderable@Ogre@@@std@@@std@@@2@W4ShadowTechnique@2@PBVLight@2@PAVHardwareIndexBufferSharedPtr@2@_NMK@Z)
1>NxOgreOGRE3D_Debug.lib(OGRE3DRenderable.obj) : error LNK2001: unresolved external symbol "protected: virtual void __thiscall Ogre::ShadowCaster::generateShadowVolume(class Ogre::EdgeData *,class Ogre::HardwareIndexBufferSharedPtr const &,class Ogre::Light const *,class std::vector<class Ogre::ShadowRenderable *,class std::allocator<class Ogre::ShadowRenderable *> > &,unsigned long)" (?generateShadowVolume@ShadowCaster@Ogre@@MAEXPAVEdgeData@2@ABVHardwareIndexBufferSharedPtr@2@PBVLight@2@AAV?$vector@PAVShadowRenderable@Ogre@@V?$allocator@PAVShadowRenderable@Ogre@@@std@@@std@@K@Z)
1>NxOgreOGRE3D_Debug.lib(OGRE3DRenderable.obj) : error LNK2001: unresolved external symbol "protected: virtual void __thiscall Ogre::AnimableObject::initialiseAnimableDictionary(class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > &)const " (?initialiseAnimableDictionary@AnimableObject@Ogre@@MBEXAAV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@@Z)


I've tried rebuilding NxOgre but it still gives me these errors. Surprisingly, the program ran properly once before these errors appeared and has not been able to run since.

I only have these NxOgre-related codes in my project:


// Setup NxOgre
void Setup_NxOgre ()
{
mWorld = NxOgre::World::createWorld();

mScene = mWorld->createScene();
mRenderSystem = new OGRE3DRenderSystem(mScene, mSceneMgr);

NxOgre::Box* box = new NxOgre::Box(100.0f,100.0f,100.0f);
mCube = mRenderSystem->createBody(box, NxOgre::Vec3(0.0f, 200.0f, 0.0f), "box.mesh");
}


Also, here's my list of included libraries:

#ifdef _DEBUG
#pragma comment (lib, "OgreMain_d.lib")
#pragma comment (lib, "OIS_d.lib")
#pragma comment (lib, "NxOgre_Debug.lib")
#pragma comment (lib, "NxOgreOGRE3D_Debug.lib")
#else
#pragma comment (lib, "OgreMain.lib")
#pragma comment (lib, "OIS.lib")
#pragma comment (lib, "NxOgre.lib")
#endif

#pragma comment (lib, "NxCharacter.lib")
#pragma comment (lib, "PhysXCooking.lib")
#pragma comment (lib, "PhysXLoader.lib")

TechnoBulldog

13-11-2010 13:28:58

Shouldn't you link to the release counterpart to NxOgreOGRE3D_Debug.lib? Which version of NxOgre are you using?

Cheriburo

13-11-2010 13:35:05

I am currently using the master commit of NxOgre and I am currently using debug mode.

TechnoBulldog

13-11-2010 14:18:25

I am currently using the master commit of NxOgre and I am currently using debug mode.
I believe that is 1.6 or 1.7, either way, after 1.6 the Renderer was forked off into Critter. I think using Critter in your application will solve the problem, see these links:

https://github.com/betajaen/critter
https://github.com/betajaen/nxogretutorials

Does this help at all?

Cheriburo

13-11-2010 14:41:38

I just tried including critter.h but it came up with alot of errors such as:

error C2039: 'RigidBodyType_USER_BEGIN' : is not a member of 'NxOgre::Enums'

I checked that my NxOgreCommon.h does not have RigidBodyType_USER_BEGIN.

betajaen

13-11-2010 14:41:45

You need these:
https://github.com/betajaen/nxogre/zipball/detritus (Detritus)
https://github.com/betajaen/critter/zipball/master (Critter)

And you could probably use these:
https://github.com/betajaen/nxogretutor ... all/master (Tutorials)


Make sure you delete your existing NxOgre (Bloody Mess), OGRE3D RenderSystem before you install these.

Cheriburo

13-11-2010 15:05:27

Ok I am currently trying to build the tutorials but I encountered the unresolved external symbol errors again!

Error 2 error LNK2019: unresolved external symbol "__declspec(dllimport) public: class Ogre::MapIterator<class std::map<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class Ogre::ResourceManager *,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,class Ogre::ResourceManager *> > > > __thiscall Ogre::ResourceGroupManager::getResourceManagerIterator(void)" (__imp_?getResourceManagerIterator@ResourceGroupManager@Ogre@@QAE?AV?$MapIterator@V?$map@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAVResourceManager@Ogre@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@V?$allocator@U?$pair@$$CBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAVResourceManager@Ogre@@@std@@@2@@std@@@2@XZ) referenced in function "protected: virtual void __thiscall OgreBites::Sample::unloadResources(void)" (?unloadResources@Sample@OgreBites@@MAEXXZ) Sandbox.obj Sandbox

Error 3 error LNK2001: unresolved external symbol "public: virtual class Ogre::VectorIterator<class std::vector<class Ogre::ShadowRenderable *,class std::allocator<class Ogre::ShadowRenderable *> > > __thiscall Ogre::MovableObject::getShadowVolumeRenderableIterator(enum Ogre::ShadowTechnique,class Ogre::Light const *,class Ogre::HardwareIndexBufferSharedPtr *,bool,float,unsigned long)" (?getShadowVolumeRenderableIterator@MovableObject@Ogre@@UAE?AV?$VectorIterator@V?$vector@PAVShadowRenderable@Ogre@@V?$allocator@PAVShadowRenderable@Ogre@@@std@@@std@@@2@W4ShadowTechnique@2@PBVLight@2@PAVHardwareIndexBufferSharedPtr@2@_NMK@Z) CritterDebugStatic.lib Sandbox

Error 4 error LNK2001: unresolved external symbol "protected: virtual void __thiscall Ogre::ShadowCaster::generateShadowVolume(class Ogre::EdgeData *,class Ogre::HardwareIndexBufferSharedPtr const &,class Ogre::Light const *,class std::vector<class Ogre::ShadowRenderable *,class std::allocator<class Ogre::ShadowRenderable *> > &,unsigned long)" (?generateShadowVolume@ShadowCaster@Ogre@@MAEXPAVEdgeData@2@ABVHardwareIndexBufferSharedPtr@2@PBVLight@2@AAV?$vector@PAVShadowRenderable@Ogre@@V?$allocator@PAVShadowRenderable@Ogre@@@std@@@std@@K@Z) CritterDebugStatic.lib Sandbox

Error 5 error LNK2001: unresolved external symbol "protected: virtual void __thiscall Ogre::AnimableObject::initialiseAnimableDictionary(class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > &)const " (?initialiseAnimableDictionary@AnimableObject@Ogre@@MBEXAAV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@@Z) CritterDebugStatic.lib Sandbox

Error 6 fatal error LNK1120: 4 unresolved externals Sandbox\Debug\SandboxDebug.dll Sandbox

These are pretty much the same errors I've been encountering when I was still using BloodyMess.

betajaen

13-11-2010 15:11:04

Okay, those are Ogre errors. Have you built Ogre correctly? Are you using Ogre 1.7.x?

Cheriburo

13-11-2010 15:19:36

Yeah I am using Ogre v1.7.1.

EDIT: Ok it seems that my OGRE wasn't built correctly. I am getting those unresolved external symbol errors from building OGRE now.

EDIT2: I can't seem to build the OGRE samples. I'm getting unresolved external symbol errors like:

Error 1 error LNK2019: unresolved external symbol "__declspec(dllimport) public: class Ogre::MapIterator<class std::map<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class Ogre::ResourceManager *,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,class Ogre::ResourceManager *> > > > __thiscall Ogre::ResourceGroupManager::getResourceManagerIterator(void)" (__imp_?getResourceManagerIterator@ResourceGroupManager@Ogre@@QAE?AV?$MapIterator@V?$map@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAVResourceManager@Ogre@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@V?$allocator@U?$pair@$$CBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAVResourceManager@Ogre@@@std@@@2@@std@@@2@XZ) referenced in function "protected: virtual void __thiscall OgreBites::Sample::unloadResources(void)" (?unloadResources@Sample@OgreBites@@MAEXXZ) BezierPatch.obj Sample_BezierPatch

Error 2 error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::list<struct Ogre::ResourceGroupManager::ResourceLocation *,class std::allocator<struct Ogre::ResourceGroupManager::ResourceLocation *> > const & __thiscall Ogre::ResourceGroupManager::getResourceLocationList(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_?getResourceLocationList@ResourceGroupManager@Ogre@@QAEABV?$list@PAUResourceLocation@ResourceGroupManager@Ogre@@V?$allocator@PAUResourceLocation@ResourceGroupManager@Ogre@@@std@@@std@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@4@@Z) referenced in function "protected: virtual bool __thiscall OgreBites::Sample::initializeRTShaderSystem(class Ogre::SceneManager *)" (?initializeRTShaderSystem@Sample@OgreBites@@MAE_NPAVSceneManager@Ogre@@@Z) BezierPatch.obj Sample_BezierPatch

Error 3 error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > __thiscall Ogre::ResourceGroupManager::getResourceGroups(void)" (__imp_?getResourceGroups@ResourceGroupManager@Ogre@@QAE?AV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@XZ) referenced in function "protected: virtual bool __thiscall OgreBites::Sample::initializeRTShaderSystem(class Ogre::SceneManager *)" (?initializeRTShaderSystem@Sample@OgreBites@@MAE_NPAVSceneManager@Ogre@@@Z) BezierPatch.obj Sample_BezierPatch

Error 4 error LNK2019: unresolved external symbol "__declspec(dllimport) public: class Ogre::VectorIterator<class std::vector<class Ogre::Technique *,class std::allocator<class Ogre::Technique *> > > __thiscall Ogre::Material::getTechniqueIterator(void)" (__imp_?getTechniqueIterator@Material@Ogre@@QAE?AV?$VectorIterator@V?$vector@PAVTechnique@Ogre@@V?$allocator@PAVTechnique@Ogre@@@std@@@std@@@2@XZ) referenced in function "public: virtual class Ogre::Technique * __thiscall ShaderGeneratorTechniqueResolverListener::handleSchemeNotFound(unsigned short,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class Ogre::Material *,unsigned short,class Ogre::Renderable const *)" (?handleSchemeNotFound@ShaderGeneratorTechniqueResolverListener@@UAEPAVTechnique@Ogre@@GABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAVMaterial@3@GPBVRenderable@3@@Z) BezierPatch.obj Sample_BezierPatch

Error 5 error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::vector<class Ogre::RTShader::SubRenderState *,class std::allocator<class Ogre::RTShader::SubRenderState *> > const & __thiscall Ogre::RTShader::RenderState::getTemplateSubRenderStateList(void)const " (__imp_?getTemplateSubRenderStateList@RenderState@RTShader@Ogre@@QBEABV?$vector@PAVSubRenderState@RTShader@Ogre@@V?$allocator@PAVSubRenderState@RTShader@Ogre@@@std@@@std@@XZ) referenced in function "public: virtual bool __thiscall OgreBites::SdkSample::keyPressed(class OIS::KeyEvent const &)" (?keyPressed@SdkSample@OgreBites@@UAE_NABVKeyEvent@OIS@@@Z) BezierPatch.obj Sample_BezierPatch

Error 6 fatal error LNK1120: 5 unresolved externals ..\..\bin\Debug\Sample_BezierPatch_d.dll Sample_BezierPatch



As much as I'd love to search for the solution myself, hardly anything comes up when I search for such errors.

EDIT3: After rebuilding everything and making sure everything(include, lib, etc) was in the right place, the errors disappeared! Thanks to everyone who helped!