Compilation error LNK2001

muniraj_143

18-07-2008 20:07:59

I need help
I compiled and got these errors
The Ode_core, prefab, Loader compiled but the problem is with the example.
Plz help me

Error 1 error LNK2001: unresolved external symbol "__declspec(dllimport) public: struct OIS::MouseState const & __thiscall OIS::Mouse::getMouseState(void)const " (__imp_?getMouseState@Mouse@OIS@@QBEABUMouseState@2@XZ) GranTurismOgre.obj
Error 2 error LNK2001: unresolved external symbol "__declspec(dllimport) public: static void __cdecl OIS::InputManager::destroyInputSystem(class OIS::InputManager *)" (__imp_?destroyInputSystem@InputManager@OIS@@SAXPAV12@@Z) GranTurismOgre.obj
Error 3 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) GranTurismOgre.obj
Error 4 error LNK2001: unresolved external symbol "__declspec(dllimport) public: bool __thiscall OIS::MouseState::buttonDown(enum OIS::MouseButtonID)const " (__imp_?buttonDown@MouseState@OIS@@QBE_NW4MouseButtonID@2@@Z) GranTurismOgre.obj
Error 5 fatal error LNK1120: 4 unresolved externals ..\..\..\..\..\Samples\Common\bin\Release/OgreOdeDemo_GranTurismOgre.exe

rewb0rn

18-07-2008 21:16:50

you need to link against ois, you can find it in the wiki.

muniraj_143

21-07-2008 00:36:10

Thanx
Yeah the issue resolved after adding the OIS.lib file
I compiled the code and it compiled without any error.
But when i run the code all the dlls are loaded and the Ogre start screen comes up. Then the program stops showing an error which states

OGRE EXCEPTION(4:ItemIdentityException):Resource with the name
Ac3d/apache_body/Mat001_tex00 already exits. in
ResourceManager::add at ..\src\OgreResourceManager.cpp(line 113)

I dont know how to resolve it.
Plz help me.

muniraj_143

21-07-2008 01:00:46

I also get this error

Unhandled exception at 0xffffffff in OgreOdeDemo_GranTurismOgre.exe: 0xC0000005: Access violation reading location 0xffffffff.

rewb0rn

21-07-2008 09:01:49

Try to find where Ac3d/apache_body/Mat001_tex00 is created, maybe its twice in the media files.

muniraj_143

21-07-2008 14:13:44

I resolved the problem
The problem is with the content in media files and resource.cfg
By properly referring both the things the prbl resolves.

But now when i run the example I get the following error

This application has failed to start because OgreMain.dll was not found.
Re-installing the application may fix the problem

plz help to resolve the problem

rewb0rn

21-07-2008 14:56:10

Just copy the OgreMain.dll to your project directory. Thats actually described in the basic Ogre tutorials. And please always share how you solved a problem.

muniraj_143

21-07-2008 15:34:20

As u said I copied the corresponding Lib files (release/debug) to the samples/ bin directory
I copied all the necessary lib files like ogremain.lib, ois.lib, cg.dll, OgreOde_Core.dll, OgreOde_Loader.dll, OgreOde_Prefab.dll, Plugin_BSPSceneManager.dll, Plugin_CgProgramManager.dll, Plugin_OctreeSceneManager.dll, Plugin_ParticleFX.dll, RenderSystem_Direct3D9.dll, RenderSystem_GL.dll and respective files for debug directory

Also copied the cfg files (ogre.cfg, plugin.cfg and resources.cfg) and changed the path in the resource.cfg to the corresponding path.

And the example file worked.

thanx