Compiling against Ogre svn trunk (Cthuga 1.7)

Gohla

23-05-2009 10:27:49

I'm trying to compile the latest svn trunk version of Caelum (rev 439) against Ogre Cthuga 1.7 from the svn trunk (https://ogre.svn.sourceforge.net/svnroot/ogre/trunk/) using Visual Studio 2008.
It compiles fine but at linking it gives some weird errors:

Linking...
Creating library ../lib/release/caelum.lib and object ../lib/release/caelum.exp
CaelumPlugin.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall Ogre::Resource::Resource(class Ogre::Resource const &)" (__imp_??0Resource@Ogre@@QAE@ABV01@@Z) referenced in function "public: __thiscall Caelum::PropScriptResource::PropScriptResource(class Caelum::PropScriptResource const &)" (??0PropScriptResource@Caelum@@QAE@ABV01@@Z)
CaelumScriptTranslator.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall Ogre::Resource::Resource(class Ogre::Resource const &)" (__imp_??0Resource@Ogre@@QAE@ABV01@@Z)
CaelumSystem.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall Ogre::Resource::Resource(class Ogre::Resource const &)" (__imp_??0Resource@Ogre@@QAE@ABV01@@Z)
CaelumPlugin.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class Ogre::Resource & __thiscall Ogre::Resource::operator=(class Ogre::Resource const &)" (__imp_??4Resource@Ogre@@QAEAAV01@ABV01@@Z) referenced in function "public: class Caelum::PropScriptResource & __thiscall Caelum::PropScriptResource::operator=(class Caelum::PropScriptResource const &)" (??4PropScriptResource@Caelum@@QAEAAV01@ABV01@@Z)
CaelumScriptTranslator.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class Ogre::Resource & __thiscall Ogre::Resource::operator=(class Ogre::Resource const &)" (__imp_??4Resource@Ogre@@QAEAAV01@ABV01@@Z)
CaelumSystem.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class Ogre::Resource & __thiscall Ogre::Resource::operator=(class Ogre::Resource const &)" (__imp_??4Resource@Ogre@@QAEAAV01@ABV01@@Z)
CaelumPlugin.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall Ogre::ResourceManager::ResourceManager(class Ogre::ResourceManager const &)" (__imp_??0ResourceManager@Ogre@@QAE@ABV01@@Z) referenced in function "public: __thiscall Caelum::PropScriptResourceManager::PropScriptResourceManager(class Caelum::PropScriptResourceManager const &)" (??0PropScriptResourceManager@Caelum@@QAE@ABV01@@Z)
CaelumScriptTranslator.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall Ogre::ResourceManager::ResourceManager(class Ogre::ResourceManager const &)" (__imp_??0ResourceManager@Ogre@@QAE@ABV01@@Z)
CaelumSystem.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall Ogre::ResourceManager::ResourceManager(class Ogre::ResourceManager const &)" (__imp_??0ResourceManager@Ogre@@QAE@ABV01@@Z)
CaelumPlugin.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class Ogre::ResourceManager & __thiscall Ogre::ResourceManager::operator=(class Ogre::ResourceManager const &)" (__imp_??4ResourceManager@Ogre@@QAEAAV01@ABV01@@Z) referenced in function "public: class Caelum::PropScriptResourceManager & __thiscall Caelum::PropScriptResourceManager::operator=(class Caelum::PropScriptResourceManager const &)" (??4PropScriptResourceManager@Caelum@@QAEAAV01@ABV01@@Z)
CaelumScriptTranslator.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class Ogre::ResourceManager & __thiscall Ogre::ResourceManager::operator=(class Ogre::ResourceManager const &)" (__imp_??4ResourceManager@Ogre@@QAEAAV01@ABV01@@Z)
CaelumSystem.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class Ogre::ResourceManager & __thiscall Ogre::ResourceManager::operator=(class Ogre::ResourceManager const &)" (__imp_??4ResourceManager@Ogre@@QAEAAV01@ABV01@@Z)
../bin/release/caelum.dll : fatal error LNK1120: 4 unresolved externals


I had the same problem with compiling MyGUI against Ogre 1.7 but they seemed to solve it recently (post here: viewtopic.php?f=17&t=9737&p=58713).
Does anyone know how to fix these errors?

cdleonard

24-05-2009 12:35:37

I'm sorry; but I can't seem to reproduce this issue. Try a full rebuild?

Gohla

28-05-2009 17:36:00

Tried recompiling but did not help. It might have to do something with the fact that I'm compiling Ogre 1.7 using threading = 1? I'll recompile Ogre later without threading and see if that causes the problem.

Gohla

30-05-2009 10:47:48

Compiling with threading off does work, no more linker errors! The problem seems to occur when Ogre 1.7 is compiled with threading = 1 (maybe threading = 2 also but I did not test that). Do you have any idea why threading is causing linking errors?

cdleonard

01-06-2009 00:11:58

I tried building against Ogre 1.7 with threading=1 and it works for me. I had to do a few minor adjustments to vcproj files to compensate for path changes after the cmake transition. None of those adjustments should be related to the error you posted.

Can you try again with the very latest trunk versions of both Ogre and Caelum; using the included proj files?

stealth977

17-06-2009 13:47:43

I compiled Caelum with OGRE v1.7, it runs fine except:

In OpenGL mode, disaster, the clouds are on the ground (no matter the height) and its only a night sky no matter what universal time

ismail,