I'm using microsoft visual C++ express 2010 and I'm statically linking my application. I have Multi-threaded (/MT) for relase set and Multi-threaded Debug (/MTd) for debug mode.Compiling the release version (in release mode) works fine. Lately I had to debug my application to locate some errors in my application and just then noticed that my release version in debug mode fails. Though everything works fine if I link dynamically.
Here's call stack:
Code: Select all
ntdll.dll!7c90120e()
[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
ntdll.dll!7c96ee31()
ntdll.dll!7c96f26e()
ntdll.dll!7c970456()
ntdll.dll!7c94bafc()
ntdll.dll!7c91a1ba()
ntdll.dll!7c919c0c()
ntdll.dll!7c919f68()
ntdll.dll!7c919c0c()
ntdll.dll!7c919f68()
ntdll.dll!7c919c0c()
gdi32.dll!77f521c4()
> LF.exe!malloc(unsigned int size) Line 89 + 0x3b bytes C
ffffff90()
cegui.log:
Code: Select all
07/08/2012 21:04:02 (Std) +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
07/08/2012 21:04:02 (Std) + Crazy Eddie's GUI System - Event log +
07/08/2012 21:04:02 (Std) + (http://www.cegui.org.uk/) +
07/08/2012 21:04:02 (Std) +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
07/08/2012 21:04:02 (Std) CEGUI::Logger singleton created. (00B0CC00)
07/08/2012 21:04:02 (Std)
07/08/2012 21:04:02 (Std) ********************************************************************************
07/08/2012 21:04:02 (Std) * Important: *
07/08/2012 21:04:02 (Std) * To get support at the CEGUI forums, you must post _at least_ the section *
07/08/2012 21:04:02 (Std) * of this log file indicated below. Failure to do this will result in no *
07/08/2012 21:04:02 (Std) * support being given; please do not waste our time. *
07/08/2012 21:04:02 (Std) ********************************************************************************
07/08/2012 21:04:02 (Std) ********************************************************************************
07/08/2012 21:04:02 (Std) * -------- START OF ESSENTIAL SECTION TO BE POSTED ON THE FORUM -------- *
07/08/2012 21:04:02 (Std) ********************************************************************************
07/08/2012 21:04:02 (Std) ---- Version 0.7.8 (Build: Jul 21 2012 Microsoft Windows MSVC++ 10.0 32 bit) ----
07/08/2012 21:04:02 (Std) ---- Renderer module is: CEGUI::Direct3D9Renderer - Official Direct3D 9 based 2nd generation renderer module. ----
07/08/2012 21:04:02 (Std) ---- XML Parser module is: CEGUI::ExpatParser - Official expat based parser module for CEGUI ----
07/08/2012 21:04:02 (Std) ---- Image Codec module is: SILLYImageCodec - Official SILLY based image codec ----
07/08/2012 21:04:02 (Std) ---- Scripting module is: None ----
07/08/2012 21:04:02 (Std) ********************************************************************************
07/08/2012 21:04:02 (Std) * -------- END OF ESSENTIAL SECTION TO BE POSTED ON THE FORUM -------- *
07/08/2012 21:04:02 (Std) ********************************************************************************
07/08/2012 21:04:02 (Std)
07/08/2012 21:04:02 (Std) ---- Begining CEGUI System initialisation ----
07/08/2012 21:04:02 (Std) CEGUI::ImagesetManager singleton created (00B0C500)
07/08/2012 21:04:02 (Std) CEGUI::FontManager singleton created. (00B0CF58)
07/08/2012 21:04:02 (Std) CEGUI::WindowFactoryManager singleton created
07/08/2012 21:04:02 (Std) ---- Adding pre-registered WindowFactory objects ----
07/08/2012 21:04:02 (Std) WindowFactory for 'AlphaHitWindow' windows added. (00C02980)
07/08/2012 21:04:02 (Std) CEGUI::WindowManager singleton created (00B02408)
07/08/2012 21:04:02 (Std) CEGUI::SchemeManager singleton created. (00B0F370)
07/08/2012 21:04:02 (Std) CEGUI::MouseCursor singleton created. (00AEC520)
07/08/2012 21:04:02 (Std) CEGUI::GlobalEventSet singleton created. (00B0A728)
07/08/2012 21:04:02 (Std) CEGUI::AnimationManager singleton created (00B05E98)
07/08/2012 21:04:02 (Std) CEGUI::WidgetLookManager singleton created. (00B052D0)
07/08/2012 21:04:02 (Std) CEGUI::WindowRendererManager singleton created (00B02DB8)
07/08/2012 21:04:02 (Std) CEGUI::RenderEffectManager singleton created (00B02DE0)
07/08/2012 21:04:02 (Std) Created WindowFactory for 'DefaultWindow' windows.
07/08/2012 21:04:02 (Std) WindowFactory for 'DefaultWindow' windows added. (00B108F8)
Hmm so it seems that cegui crashes while debugging release version with static linking in its initialisation but I have no idea why. And after getting the error:
Code: Select all
Windows has triggered a breakpoint in LF.exe.
This may be due to a corruption of the heap, which indicates a bug in LF.exe or any of the DLLs it has loaded.
This may also be due to the user pressing F12 while LF.exe has focus.
The output window may have more diagnostic information.
I can press continue in my project's debug options and game runs properly. I suppose I'm doing everything properly there but here's initialisation code:
Code: Select all
using namespace CEGUI;
CEGUI::WindowFactoryManager::addFactory<CEGUI::TplWindowFactory<AlphaHitWindow> >();
myRenderer = &CEGUI::Direct3D9Renderer::bootstrapSystem( Input::Obj().d3dDevice );
DefaultResourceProvider* rp = static_cast<DefaultResourceProvider*>(CEGUI::System::getSingleton().getResourceProvider());
rp->setResourceGroupDirectory("schemes", "schemes/");
rp->setResourceGroupDirectory("imagesets", "sprite/");
rp->setResourceGroupDirectory("fonts", "fonts/");
rp->setResourceGroupDirectory("layouts", "layouts/");
rp->setResourceGroupDirectory("looknfeels", "looknfeel/");
CEGUI::Imageset::setDefaultResourceGroup("imagesets");
CEGUI::Font::setDefaultResourceGroup("fonts");
CEGUI::Scheme::setDefaultResourceGroup("schemes");
CEGUI::WidgetLookManager::setDefaultResourceGroup("looknfeels");
CEGUI::WindowManager::setDefaultResourceGroup("layouts");
CEGUI::SchemeManager::getSingleton().create( "Game.scheme" );
CEGUI::FontManager::getSingleton().create( "NEORD.font" );
System::getSingleton().setDefaultFont( "NEORD" );
System::getSingleton().setDefaultMouseCursor( "Game", "MouseArrow" );
Input::Obj().d3dDevice->CreateStateBlock( D3DSBT_ALL, &pStateBlock );
WindowManager& wmgr = WindowManager::getSingleton();
myRoot = wmgr.createWindow( "DefaultWindow", "root" );
System::getSingleton().setGUISheet( myRoot );