Linker Error *Solved*

Kvadrat

24-04-2009 21:51:20

Ok! I'm a total newbie to Ogre and I have never made any serious project with VC++, but I know the syntax and I'm somewhere between beginer and intermediate in it, I have been working with Delphi a lot and know the concepts of programing and their representations in c++, it's just that I'm getting used to it. I've got the OGRE SDK installed, and it is running fine ("running's" not the word but still). So, I downloaded the source of plsm2 from the svn and tried to build it. I followed strictly the tutorial at the wiki (I have vc9). The compiling went well but the linker is giving me some hard time. I have been playing around a bit, but I finally gave up on trying to figure it out (did I mention that I'm new to vc). I'm probably making a common and silly mistake (and after a few months I'll be laughing at this), but right now I have no clue what the reason for the following log could be:

Linking...
Creating library ..\bin\Debug/Plugin_PagingLandScapeSceneManager2_d.lib and object ..\bin\Debug/Plugin_PagingLandScapeSceneManager2_d.exp
OgrePagingLandScapeSceneManagerDll.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall Ogre::Root::addSceneManagerFactory(class Ogre::SceneManagerFactory *)" (__imp_?addSceneManagerFactory@Root@Ogre@@QAEXPAVSceneManagerFactory@2@@Z) referenced in function _dllStartPlugin
OgrePagingLandScapeSceneManager.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class Ogre::Root & __cdecl Ogre::Root::getSingleton(void)" (__imp_?getSingleton@Root@Ogre@@SAAAV12@XZ)
OgrePagingLandScapeMeshDecal.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class Ogre::Root & __cdecl Ogre::Root::getSingleton(void)" (__imp_?getSingleton@Root@Ogre@@SAAAV12@XZ) referenced in function "private: void __thiscall Ogre::PagingLandScapeMeshDecal::CreateGeometry(void)" (?CreateGeometry@PagingLandScapeMeshDecal@Ogre@@AAEXXZ)
OgrePagingLandScapeRenderable.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class Ogre::Root & __cdecl Ogre::Root::getSingleton(void)" (__imp_?getSingleton@Root@Ogre@@SAAAV12@XZ)
OgrePagingLandScapeSceneManagerDll.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class Ogre::Root & __cdecl Ogre::Root::getSingleton(void)" (__imp_?getSingleton@Root@Ogre@@SAAAV12@XZ)
OgrePagingLandScapeOctreeIntersectionSceneQuery.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class Ogre::Root & __cdecl Ogre::Root::getSingleton(void)" (__imp_?getSingleton@Root@Ogre@@SAAAV12@XZ)
OgrePagingLandScapeOcclusion.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class Ogre::Root & __cdecl Ogre::Root::getSingleton(void)" (__imp_?getSingleton@Root@Ogre@@SAAAV12@XZ)
OgrePagingLandScapeOptions.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class Ogre::Root & __cdecl Ogre::Root::getSingleton(void)" (__imp_?getSingleton@Root@Ogre@@SAAAV12@XZ)
OgrePagingLandScapeSceneManagerDll.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static void * __cdecl Ogre::AllocatedObject<class Ogre::CategorisedAllocPolicy<3> >::operator new(unsigned int)" (__imp_??2?$AllocatedObject@V?$CategorisedAllocPolicy@$02@Ogre@@@Ogre@@SAPAXI@Z) referenced in function _dllStartPlugin
OgrePagingLandScapeOctreeSceneManager.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static void * __cdecl Ogre::AllocatedObject<class Ogre::CategorisedAllocPolicy<3> >::operator new(unsigned int)" (__imp_??2?$AllocatedObject@V?$CategorisedAllocPolicy@$02@Ogre@@@Ogre@@SAPAXI@Z)
OgrePagingLandScapeSceneManager.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static void * __cdecl Ogre::AllocatedObject<class Ogre::CategorisedAllocPolicy<3> >::operator new(unsigned int)" (__imp_??2?$AllocatedObject@V?$CategorisedAllocPolicy@$02@Ogre@@@Ogre@@SAPAXI@Z)
OgrePagingLandScapeSceneManagerDll.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall Ogre::SceneManagerFactory::SceneManagerFactory(void)" (__imp_??0SceneManagerFactory@Ogre@@QAE@XZ) referenced in function "public: __thiscall Ogre::PagingLandScapeSceneManagerFactory::PagingLandScapeSceneManagerFactory(void)" (??0PagingLandScapeSceneManagerFactory@Ogre@@QAE@XZ)

......

OgrePagingLandScapeOctreeNode.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Ogre::SceneNode::setVisible(bool,bool)" (?setVisible@SceneNode@Ogre@@UAEX_N0@Z)
OgrePagingLandScapeOctreeNode.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Ogre::SceneNode::flipVisibility(bool)" (?flipVisibility@SceneNode@Ogre@@UAEX_N@Z)
OgrePagingLandScapeOctreeNode.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Ogre::SceneNode::setDebugDisplayEnabled(bool,bool)" (?setDebugDisplayEnabled@SceneNode@Ogre@@UAEX_N0@Z)
OgrePagingLandScapeOctreeNode.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall Ogre::SceneNode::SceneNode(class Ogre::SceneManager *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_??0SceneNode@Ogre@@QAE@PAVSceneManager@1@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "public: __thiscall Ogre::PagingLandScapeOctreeNode::PagingLandScapeOctreeNode(class Ogre::SceneManager *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0PagingLandScapeOctreeNode@Ogre@@QAE@PAVSceneManager@1@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
OgrePagingLandScapeOctreeNode.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall Ogre::AxisAlignedBox::merge(class Ogre::AxisAlignedBox const &)" (__imp_?merge@AxisAlignedBox@Ogre@@QAEXABV12@@Z) referenced in function "protected: virtual void __thiscall Ogre::PagingLandScapeOctreeNode::_updateBounds(void)" (?_updateBounds@PagingLandScapeOctreeNode@Ogre@@MAEXXZ)
Build log was saved at "file://d:\Program Files\OgreSDK\paginglandscape\PlugIns\PagingLandScape2\obj\Debug\BuildLog.htm"
Plugin_PagingLandScapeSceneManager2 - 1158 error(s), 0 warning(s)


Thanks in advance. Any help will be apreciated.

P.S. I know that there are probably thousands of posts like this one every month. I just hope I'm not annoying or anything and if so please forgive me.

stealth977

26-04-2009 21:21:31

It seems to me that you are not linking to OgreMain.lib (or OgreMain_d.lib).

Goto Project->Properties->Linker->Additional Libraries and add OgreMain.lib (for release) or OgreMain_d.lib (for Debug)

ismail,

Kvadrat

29-04-2009 04:11:39

It worked! Thanks a lot. I wouldn't have guessed that OgreMain.lib was missing.