[SOLVED]Linker errors on OgreNewt tutorial

neomxl

30-11-2007 17:39:41

Hello again,

I cannot seem to get rid of some link errors when I am compiling the tutorial.

---------------

OgreNewtApplication.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class OIS::InputManager * __cdecl OIS::InputManager::createInputSystem(class std::multimap<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >,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 std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > > &)" (__imp_?createInputSystem@InputManager@OIS@@SAPAV12@AAV?$multimap@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@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@@V12@@std@@@2@@std@@@Z) referenced in function "public: __thiscall ExampleFrameListener::ExampleFrameListener(class Ogre::RenderWindow *,class Ogre::Camera *,bool,bool,bool)" (??0ExampleFrameListener@@QAE@PAVRenderWindow@Ogre@@PAVCamera@2@_N22@Z)



OgreNewt_Main_d.lib(OgreNewt_BasicFrameListener.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class OIS::InputManager * __cdecl OIS::InputManager::createInputSystem(class std::multimap<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,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 std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > > &)" (__imp_?createInputSystem@InputManager@OIS@@SAPAV12@AAV?$multimap@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@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@@V12@@std@@@2@@std@@@Z)
OgreNewtApplication.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: struct OIS::MouseState const & __thiscall OIS::Mouse::getMouseState(void)const " (__imp_?getMouseState@Mouse@OIS@@QBEABUMouseState@2@XZ) referenced in function "public: virtual void __thiscall ExampleFrameListener::windowResized(class Ogre::RenderWindow *)" (?windowResized@ExampleFrameListener@@UAEXPAVRenderWindow@Ogre@@@Z)



OgreNewtApplication.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static void __cdecl OIS::InputManager::destroyInputSystem(class OIS::InputManager *)" (__imp_?destroyInputSystem@InputManager@OIS@@SAXPAV12@@Z) referenced in function "public: virtual void __thiscall ExampleFrameListener::windowClosed(class Ogre::RenderWindow *)" (?windowClosed@ExampleFrameListener@@UAEXPAVRenderWindow@Ogre@@@Z)



OgreNewtApplication.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall OIS::MouseState::buttonDown(enum OIS::MouseButtonID)const " (__imp_?buttonDown@MouseState@OIS@@QBE_NW4MouseButtonID@2@@Z) referenced in function "public: bool __thiscall ExampleFrameListener::processUnbufferedMouseInput(struct Ogre::FrameEvent const &)" (?processUnbufferedMouseInput@ExampleFrameListener@@QAE_NABUFrameEvent@Ogre@@@Z)

-------------

I'm not really sure where to start getting rid of these. I've had a look around and all my directories seem in order and the code generation is set to multi-thread DLL.

I'm using VC++ 2005 Express.

Any help would be very muchly appreciated.

neomxl

01-12-2007 14:27:54

After a little playing around I switched it to Release Mode and added ois.lib. It now compiles without link errors, however, it crashes before the window can load.

When I debug it it comes down to this line:

// create the default ID.
m_defaultMatID = new OgreNewt::MaterialID( this, NewtonMaterialGetDefaultGroupID( m_world ) );


inside ogrenewt_world.cpp World ctor. I must admit I have absoloutely no idea why this won't work, especially considering as it's the http://www.ogre3d.org/wiki/index.php/Newton_Game_Dynamics Tutorial solution. I would imagine lots of people would have had this error if it was a problem with the tutorial.

I am really stumped and I really need to integrate Physics before my project can continue.

Hopefully this extra post may enlighten someone to the problem I am having.

Thanks,
neomxl

neomxl

04-12-2007 18:45:28

I didn't pinpoint the problem exactly, but I messed around with all the .cfg files and now it works.

I'm guessing I had a wrong .cfg file somewhere and starting it from scratch fixed it

(I copy all my .cfg files into the same directoyr rather than in the SDK Dir so I coppied them over from a project that worked).

Hope this helps anyone else ^^/