Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: [SFML 2/CEGUI 0.7.7] terminate called after throwing an instance of char const*  (Read 4963 times)

0 Members and 1 Guest are viewing this topic.

Flaco

  • Newbie
  • *
  • Posts: 36
  • Glory to Arztotzka!
    • View Profile
    • Core Unit
    • Email
Hi guys!

So, I try to using CEGUI in SFML 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! :)
« Last Edit: July 26, 2012, 03:49:16 am by Flaco »

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
But when I try to compile, my compiler (GCC 4.6.3 on Ubuntu 12.04) return me this:
GCC crashes ?
Want to play movies in your SFML application? Check out sfeMovie!

Flaco

  • Newbie
  • *
  • Posts: 36
  • Glory to Arztotzka!
    • View Profile
    • Core Unit
    • Email
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.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10801
    • View Profile
    • development blog
    • Email
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 for SFML?
« Last Edit: July 25, 2012, 05:14:51 pm by eXpl0it3r »
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Flaco

  • Newbie
  • *
  • Posts: 36
  • Glory to Arztotzka!
    • View Profile
    • Core Unit
    • Email
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!
« Last Edit: July 26, 2012, 03:48:16 am by Flaco »

Flaco

  • Newbie
  • *
  • Posts: 36
  • Glory to Arztotzka!
    • View Profile
    • Core Unit
    • Email
Nobody can help me? I try to resolve this since my last message but in vain. :/

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10801
    • View Profile
    • development blog
    • Email
I guess no one else uses CEGUI... (I mean there's SFGUI, who would want to deal with CEGUI?) :P

Also keep in mind that this tutorial 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 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?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Flaco

  • Newbie
  • *
  • Posts: 36
  • Glory to Arztotzka!
    • View Profile
    • Core Unit
    • Email
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

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10801
    • View Profile
    • development blog
    • Email
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.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Flaco

  • Newbie
  • *
  • Posts: 36
  • Glory to Arztotzka!
    • View Profile
    • Core Unit
    • Email
(Very) Interesting! Thank you! :)

Have a nice Day/Evening! :)