SFML community forums

Help => General => Topic started by: Flaco on July 25, 2012, 07:01:37 am

Title: [SFML 2/CEGUI 0.7.7] terminate called after throwing an instance of char const*
Post by: Flaco on July 25, 2012, 07:01:37 am
Hi guys!

So, I try to using CEGUI in SFML (http://www.sfml-dev.org/wiki/en/tutorials/cegui) like in this tutorial, but with the SFML 2.0 (that I had on the SFGUI repositories ^^') and with the latest release of CEGUI (0.7.7).

But when I try to compile, my compiler (GCC 4.6.3 on Ubuntu 12.04) return me this:

terminate called after throwing an instance of 'char const*'
Abandon (core dumped)


I make some test, apparently I haven't any problems with SFML. Here's the minimal code for the error:

#include <iostream>
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include <SFML/System.hpp>
#include <CEGUI/CEGUI.h>
#include <CEGUI/RendererModules/OpenGL/CEGUIOpenGLRenderer.h>

int main(int argc, char* argv[])
{

  sf::RenderWindow win(sf::VideoMode(800, 600, 32), "ExceptionTest");
 
  //create an OpenGL renderer and initialize a CEGUI::System object
  CEGUI::OpenGLRenderer& myRenderer = CEGUI::OpenGLRenderer::bootstrapSystem();

  while(win.isOpen())
    {
      sf::Event evt;
      while(win.pollEvent(evt))
        {
          switch(evt.type)
            {
            case sf::Event::Closed:
              win.close();
              break;
            }
        }
      win.clear();
      CEGUI::System::getSingleton().renderGUI();
      win.display();
    }

  return EXIT_SUCCESS;
}
 


Soo.. hum.. I don't really understand what's happening... hope you can help me!

Thank you! :)
Title: Re: [SFML 2/CEGUI 0.7.7] terminate called after throwing an instance of char const*
Post by: Ceylo on July 25, 2012, 09:14:21 am
But when I try to compile, my compiler (GCC 4.6.3 on Ubuntu 12.04) return me this:
GCC crashes ?
Title: Re: [SFML 2/CEGUI 0.7.7] terminate called after throwing an instance of char const*
Post by: Flaco on July 25, 2012, 04:36:55 pm
I don't think, I haven't any problems to compile a CEGUI application. It seems that I have that problem when CEGUI & SFML are together.
Title: Re: [SFML 2/CEGUI 0.7.7] terminate called after throwing an instance of char const*
Post by: eXpl0it3r on July 25, 2012, 04:49:04 pm
If GCC returns that instead of compiling then GCC has crashed...

Make sure GCC isn't corrupted and neither is your filesystem.

Could you give us the full commands you use for compilation & linkage?

Btw are you aware of that there's a French forum (http://fr.sfml-dev.org/forums/) for SFML?
Title: Re: [SFML 2/CEGUI 0.7.7] terminate called after throwing an instance of char const*
Post by: Flaco on July 25, 2012, 05:13:29 pm
Okay thank you! Yes I wrote:
g++ main.cpp -o myApp -lCEGUIBase -lCEGUIOpenGLRenderer -lSILLY -lsfml-graphics -lsfml-window -lsfml-system

Thank you for your help! :)

EDIT: Oh when I say "when I compile" is when I wrote:
./myApp
because gcc create that file, I'm relatively new with Gnu/Linux so I don't know if "compile" is appropriate at this step...

I'm sorry

EDIT²: I tried to compile de same code (adapted) with SFML 1.6 but I have the same error. I try a apt-get remove gcc and a re-installation but it doesn't change anything. I'll try to compile on Backtrack or on Windows. Anybody knows who can I "repair" gcc? :/

Thank you again!
Title: Re: [SFML 2/CEGUI 0.7.7] terminate called after throwing an instance of char const*
Post by: Flaco on July 27, 2012, 08:10:08 pm
Nobody can help me? I try to resolve this since my last message but in vain. :/
Title: Re: [SFML 2/CEGUI 0.7.7] terminate called after throwing an instance of char const*
Post by: eXpl0it3r on July 27, 2012, 09:01:18 pm
I guess no one else uses CEGUI... (I mean there's SFGUI (http://sfgui.sfml-dev.de), who would want to deal with CEGUI?) :P

Also keep in mind that this tutorial (http://www.sfml-dev.org/wiki/en/tutorials/cegui) was last edited on 2010/12/17 05:54, so it's about 1.5y old. This would normally alert me and I'd go to the original source (http://www.cegui.org.uk/wiki/index.php/Category:Tutorials) and look what they suggest there and if needed use some hints from the old tutorial.

Then there's also gdb which will let you debug your application and find out where that char const* is thrown.

Just out of curiosity, is there a big advantage in your mind using CEGUI over SFGUI?
Title: Re: [SFML 2/CEGUI 0.7.7] terminate called after throwing an instance of char const*
Post by: Flaco on July 27, 2012, 09:20:33 pm
Well, not really. I test CEGUI, I though CEGUI's GUI was more "customizable".
But I test SFGUI and it's really easy to use, I just use CEGUI to "compare" them. (Not really compare, more like.. trying!) .

For CEGUI I had no worries to "keep the code updated".

Well, thank you for your advices eXpl0it3r. :)

I think I'll take a... "in-depth look" to SFGUI, see if I can customize easily the GUI... :)

Thank you for your help everybody! :D
Title: Re: [SFML 2/CEGUI 0.7.7] terminate called after throwing an instance of char const*
Post by: eXpl0it3r on July 27, 2012, 09:57:27 pm
I think I'll take a... "in-depth look" to SFGUI, see if I can customize easily the GUI... :)
SFGUI can make use of files with similarities to Cascading Style Sheet (CSS) and thus you can generate various nice things. Unfortunatly there exists at the moment only a shape and line renderer called BREW which is not able to use images for your widgets. The bitmap renderer that should implement this, Bob, hasn't been work on for a very long time and probably needs a whole new rewrite. The developer of that renderer is unfortunatly still serving in the Swiss army. Hopefully he'll again pick that project up soon after. ;)

As for an example see here (http://www.flexworld-game.com/resources/screenshots/gui/thumb_controls.png).
Title: Re: [SFML 2/CEGUI 0.7.7] terminate called after throwing an instance of char const*
Post by: Flaco on July 27, 2012, 10:35:10 pm
(Very) Interesting! Thank you! :)

Have a nice Day/Evening! :)