[Solved] How to fix compiled error

Celest

24-06-2008 21:38:37

I compiled "OgreNewt_Main" from CVS and have errors.


Error 5 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 OgreNewt::BasicFrameListener::BasicFrameListener(class Ogre::RenderWindow *,class Ogre::SceneManager *,class OgreNewt::World *,int)" (??0BasicFrameListener@OgreNewt@@QAE@PAVRenderWindow@Ogre@@PAVSceneManager@3@PAVWorld@1@H@Z) OgreNewt_BasicFrameListener.obj




Error 6 fatal error LNK1120: 1 unresolved externals lib\Debug_DLL\OgreNewt_Main_d.dll



Error 10 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 OgreNewt::BasicFrameListener::BasicFrameListener(class Ogre::RenderWindow *,class Ogre::SceneManager *,class OgreNewt::World *,int)" (??0BasicFrameListener@OgreNewt@@QAE@PAVRenderWindow@Ogre@@PAVSceneManager@3@PAVWorld@1@H@Z) OgreNewt_BasicFrameListener.obj





Error 11 fatal error LNK1120: 1 unresolved externals lib\Release_DLL\OgreNewt_Main.dll



Thanks for advanced. :)

walaber

24-06-2008 23:19:37

because of the BasicFrameListener, you need to link OIS (it's in Ogrenew\dependencies\lib) when you compile OgreNewt.

Celest

25-06-2008 20:08:55

I use fresh Ogre3D source and correctly link to OIS lib/header.

Warning 1 warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/OPT:ICF' specification OgreNewt_BasicFrameListener.obj


Error 5 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 OgreNewt::BasicFrameListener::BasicFrameListener(class Ogre::RenderWindow *,class Ogre::SceneManager *,class OgreNewt::World *,int)" (??0BasicFrameListener@OgreNewt@@QAE@PAVRenderWindow@Ogre@@PAVSceneManager@3@PAVWorld@1@H@Z) OgreNewt_BasicFrameListener.obj


Command C/C++
/Od /I ".\inc" /I "..\demos\Include" /I "..\..\..\NewtonSDK\sdk" /I "C:\OgreSDK2\include" /D "WIN32" /D "_DEBUG" /D "_LIB" /D "_OGRENEWT_DYNAMIC" /D "_OGRENEWT_EXPORTS" /D "_VC80_UPGRADE=0x0710" /D "_WINDLL" /D "_MBCS" /Gm /EHsc /MDd /Fo"obj\Debug_DLL\\" /Fd"obj\Debug_DLL\vc80.pdb" /W3 /nologo /c /Wp64 /ZI /TP /errorReport:prompt

Command Linker
/OUT:"lib\Debug_DLL\OgreNewt_Main_d.dll" /NOLOGO /LIBPATH:"C:\OgreSDK2\lib" /LIBPATH:"..\..\..\NewtonSDK\sdk\dll" /DLL /MANIFEST /MANIFESTFILE:"obj\Debug_DLL\OgreNewt_Main_d.dll.intermediate.manifest" /ERRORREPORT:PROMPT OgreMain_d.lib newton.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

I link OIS in Dependencies or prebuilt sdk. It has same error.

Celest

26-06-2008 07:36:51

[Problem solved] - I comment out those lines

OgreNewt_BasicFrameListener.h
Line 29 - #include <OIS/OIS.h>
Line 57 - OIS::InputManager* mInputManager;
Line 58 - OIS::Keyboard* mKeyboard;


OgreNewt_BasicFrameListener.cpp
Line 17 - Line 30
// add the standard debug viewer.
/*
Debugger::getSingleton().init( mgr );

OIS::ParamList pl;
size_t windowHnd = 0;
std::ostringstream windowHndStr;

win->getCustomAttribute("WINDOW", &windowHnd);
windowHndStr << windowHnd;
pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));

mInputManager = OIS::InputManager::createInputSystem( pl );

//Create all devices (We only catch joystick exceptions here, as, most people have Key/Mouse)
mKeyboard = static_cast<OIS::Keyboard*>(mInputManager->createInputObject( OIS::OISKeyboard, false ));


Line 81 - Line 90 (Debugger)
mKeyboard->capture();

if (mKeyboard->isKeyDown(OIS::KC_F3))
{
Debugger::getSingleton().showLines( m_World );
}
else
{
Debugger::getSingleton().hideLines();
}


It seems debugger has problem. Please check it :wink: (I use fresh Eihort 1.4.9 , CEGUI and original OIS header/lib)