Page 1 of 1

Second chance exception on CEGUI::System::getSingleton().*

Posted: Thu Apr 07, 2016 17:49
by Pilgrim0819
Hi!

I'm pretty new to C++, OpenGL and mostly CEGUI, but I am working on a school project. The main application runs fine, now I only want to add some GUI elements with CEGUI. My problem is, after calling CEGUI::OpenGLRenderer::bootstrapSystem(); I simply want to render the GUI (or do ANYTHING with CEGUI::System). But no matter what I try, my application always crashes. gDEBugger showed me it is a Second chance exception, "the thread tried to read from or write to a virtual address for which it does not have access".

Now I understand, what the exception mean and I tried to find some solution using Google of course, but right now I am simply stuck.

I am using CEGUI 0.7.5 (I know... please focus on the problem) and SDL2. I've set all search directories in code::blocks, the linker options as well and copied the required .dlls to the right folder. (Yeah, I've included the headers :D )

If you need some code snippets, let me know, but right know I have no idea what can be wrong and I don't want to spam the forum with all my codes. :)

Thanks for any help in advance!

Re: Second chance exception on CEGUI::System::getSingleton().*

Posted: Thu Apr 07, 2016 18:49
by YaronCT
Pilgrim0819: let's start with a backtrace. And plz post the most minimal cegui code that doesn't work for u. That should do for a start.

Re: Second chance exception on CEGUI::System::getSingleton().*

Posted: Sat Apr 09, 2016 09:34
by Ident
Did you create the opengl context before you do this call?

Re: Second chance exception on CEGUI::System::getSingleton().*

Posted: Sun Apr 10, 2016 14:13
by Pilgrim0819
First of all, yes, I create the oepngl context before this call. Basically, I start to initialize CEGUI after anything else...

Now the minimal code is really not much, but here it is:

(after initializing SDL...)
void SDLManager::initCEGUI(){
CEGUI::OpenGLRenderer& cegui_renderer = CEGUI::OpenGLRenderer::create(CEGUI::Size(1024.f, 768.f));
}

(later on, at the end of my Draw() function...)
CEGUI::System::getSingleton().renderGUI();

And this line causes my app to crash. (Or any other CEGUI::System::getSingleton().* function calls).

Re: Second chance exception on CEGUI::System::getSingleton().*

Posted: Sun Apr 10, 2016 14:19
by Ident
please post the log and show the callstack..