Page 1 of 1

Linker problems under VC8 with Ogre

Posted: Mon Mar 06, 2006 02:13
by slog
Apologies if this isn't the right place to post this question, but I have a problem with building the 0.4.1 version of CEGUI and getting the Ogre gui renderer (Ogre v1.07) to see some of the symbols. I am using VC8.

In the "OgreGUIRenderer" project, the following code causes a linker error:

throw InvalidRequestException((utf8*)"OgreCEGUIResourceProvider::loadRawDataContainer - Unable to open resource file '" + filename + (utf8*)"' in resource group '" + orpGroup + (utf8*)"'.");

On closer investigation, however, the following will link successfully:

String result = (utf8*)"OgreCEGUIResourceProvider::loadRawDataContainer - Unable to open resource file '" + filename;


but this won't:

result = filename + (utf8*)"OgreCEGUIResourceProvider::loadRawDataContainer - Unable to open resource file '";


The linker gives the following error message:

OgreCEGUIResourceProvider.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class CEGUI::String __cdecl CEGUI::operator+(class CEGUI::String,char const *)" (__imp_??HCEGUI@@YA?AVString@0@V10@PBD@Z) referenced in function "public: virtual void __thiscall CEGUI::OgreCEGUIResourceProvider::loadRawDataContainer(class CEGUI::String const &,class CEGUI::RawDataContainer &,class CEGUI::String const &)" (?loadRawDataContainer@OgreCEGUIResourceProvider@CEGUI@@UAEXABVString@2@AAVRawDataContainer@2@0@Z)

With these problematic lines commented out, everything compiles, links and runs fine (or at least, seemingly :-) ). Still, I shouldn't need to comment out these lines. No one else seems to have had this same problem, so any help would be greatly appreciated.

Posted: Mon Mar 06, 2006 06:16
by CrazyEddie
This is actuallu quite a common issue that people have when trying to update the CEGUI version from the one that comes in the Ogre dependency pack.

The code that you are compiling is picking up the old 0.3.0 version headers that come with Ogre, rather than the new ones you should be compiling against. In order to fix this you must delete all of the CEGUI headers, libs and dlls from the Ogre dependencies and replace them with the new headers, and freshly compiled libs and dlls from the newer CEGUI version.

HTH

CE.

Posted: Mon Mar 06, 2006 22:41
by slog
Thankyou. That has done the trick.