Compiling CaelumDemo for Ogre 1.7/CEGUI 0.7

duststorm

15-08-2010 03:20:25

I tried compiling the Caelum demos with the new ogre and CEGUI, and got stuck somewhere down the line.
What I did was the following:
Install latest CEGUI, more info on that at these links
http://www.ogre3d.org/tikiwiki/Building ... e=Cookbook
http://www.cegui.org.uk/wiki/index.php/ ... _for_Linux

Then I altered the demo source so it was compatible with the new CEGUI API.
There are two files you need to alter,
In CaelumLab.h, change:

// Reversing these two causes a crash.
std::auto_ptr<CEGUI::Renderer> mGuiRenderer;
std::auto_ptr<CEGUI::System> mGuiSystem;

into:

// Reversing these two causes a crash.
CEGUI::OgreRenderer* mGuiRenderer;
CEGUI::System* mGuiSystem;

and in CaelumLab.cpp, change:

void CaelumLabFrameListener::initGui () {
mGuiRenderer.reset(new CEGUI::OgreCEGUIRenderer (
mWindow, Ogre::RENDER_QUEUE_OVERLAY, false, 3000, mSceneMgr));
mGuiSystem.reset(new CEGUI::System (mGuiRenderer.get()));

into:

void CaelumLabFrameListener::initGui () {
mGuiRenderer = &CEGUI::OgreRenderer::bootstrapSystem();
mGuiSystem = CEGUI::System::getSingletonPtr();


It compiles, however, I get a segmentation fault, apparently at some code that has nothing to do with my changes.
It also happens with CaelumDemo where I didn't change anything.

The stacktrace I get when debugging with gdb is the following:
#0 0xb747f4a5 in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&) () from /usr/lib/libstdc++.so.6
#1 0xb5ee9399 in Ogre::GLRenderSystem::initialiseFromRenderSystemCapabilities(Ogre::RenderSystemCapabilities*, Ogre::RenderTarget*) ()
from /usr/lib/OGRE/RenderSystem_GL.so
#2 0xb5eecdb8 in Ogre::GLRenderSystem::_createRenderWindow(std::string const&, unsigned int, unsigned int, bool, std::map<std::string, std::string, std::less<std::string>, Ogre::STLAllocator<std::pair<std::string const, std::string>, Ogre::CategorisedAllocPolicy<(Ogre::MemoryCategory)0> > > const*) ()
from /usr/lib/OGRE/RenderSystem_GL.so
#3 0xb5f30606 in ?? () from /usr/lib/OGRE/RenderSystem_GL.so
#4 0xb5ee3b62 in Ogre::GLRenderSystem::_initialise(bool, std::string const&)
() from /usr/lib/OGRE/RenderSystem_GL.so
#5 0xb7c3efbe in Ogre::Root::initialise (this=0xb6b96260,
autoCreateWindow=true, windowTitle=..., customCapabilitiesConfig=...)
at /home/duststorm/Downloads/ogre_src_v1-7-1/OgreMain/src/OgreRoot.cpp:667
#6 0x0805e08a in ExampleApplication::configure (this=0xbffff26c)
at samples/include/ExampleApplication.h:149
#7 0x0805df43 in ExampleApplication::setup (this=0xbffff26c)
at samples/include/ExampleApplication.h:116
#8 0x0805ddd8 in ExampleApplication::go (this=0xbffff26c)
at samples/include/ExampleApplication.h:81
#9 0x0805a4c5 in main (argc=1, argv=0xbffff354)


I still need to try with RenderSystem_GL debug libraries, so I can have more details where it goes wrong there.
Apparently there is some not instanced String pointer somewhere in initialiseFromRenderSystemCapabilities, but I have no idea where exactly, it's a rather long function.

Does anyone have an idea what could be wrong?