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

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

Pilgrim0819
Just popping in
Just popping in
Posts: 2
Joined: Thu Apr 07, 2016 17:37

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

Postby Pilgrim0819 » Thu Apr 07, 2016 17:49

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!

YaronCT
CEGUI Team
Posts: 448
Joined: Fri Jun 19, 2015 12:18
Location: Kiryat-Bialik, Israel

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

Postby YaronCT » Thu Apr 07, 2016 18:49

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.

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

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

Postby Ident » Sat Apr 09, 2016 09:34

Did you create the opengl context before you do this call?
CrazyEddie: "I don't like GUIs"

Pilgrim0819
Just popping in
Just popping in
Posts: 2
Joined: Thu Apr 07, 2016 17:37

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

Postby Pilgrim0819 » Sun Apr 10, 2016 14:13

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).

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

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

Postby Ident » Sun Apr 10, 2016 14:19

please post the log and show the callstack..
CrazyEddie: "I don't like GUIs"


Return to “Help”

Who is online

Users browsing this forum: No registered users and 21 guests