Error while intialising CEGUI with SFML

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

arkdemon
Just popping in
Just popping in
Posts: 9
Joined: Fri Mar 14, 2014 20:52

Error while intialising CEGUI with SFML

Postby arkdemon » Fri Mar 14, 2014 20:57

Hello eveyrone. I am new to CEGUI and this forum. I use SFML and I tried to use CEGUI with it. However, the program crashes at:

Code: Select all

CEGUI::OpenGLRenderer::bootstrapSystem();
or

Code: Select all

CEGUI::System::create(*renderer);

It is the first time I use CEGUI. I compiled it successfully, I can run the demos but I can t make my program run. My code is just this:

Code: Select all

#include <GL/glew.h>
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
#include <CEGUI/RendererModules/OpenGL/GL3Renderer.h>
#include <CEGUI/RendererModules/OpenGL/GLRenderer.h>

int main()
{
  sf::ContextSettings sets(4,4,4,3,3);//Initialize the window
  sf::RenderWindow screen(sf::VideoMode(640, 480), "Hello CEGUI!",sf::Style::Default, sets);
  screen.setVerticalSyncEnabled(true);

  glewExperimental = GL_TRUE;//Initialize GLEW
  GLenum err = glewInit();
  if(err !=  GLEW_OK){
      printf("%s\n", glewGetErrorString(err));
  }
  if(!GLEW_VERSION_3_3){
      printf("OpenGL Version too low\n");
  }

  CEGUI::OpenGLRenderer *myRenderer = &CEGUI::OpenGLRenderer::create();//Initialize CEGUI
  CEGUI::System::create(*myRenderer);//<-- Crashes

  return 0;
}


I do not understand at all.
If someone could help me, i would be very happy and if you need more info, please ask.
Thank you

PS: there are no logs

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

Re: [Crash]Error Intializing CEGUI (First time)

Postby Ident » Sat Mar 15, 2014 09:23

"Crashes"? More info required. If there are no logs then you need to tell us your OS, your CEGUI version and your SMFL version and whateveer else could be relevant. Also why don't u tell us how it "crashes"? I am sure you get an exception or MAV and we need to know where. We release all our psychics from the cages last year so we do not have the power to magically know these things anymore.

Also did you look at this? viewtopic.php?f=2&t=6656
CrazyEddie: "I don't like GUIs"

arkdemon
Just popping in
Just popping in
Posts: 9
Joined: Fri Mar 14, 2014 20:52

Re: [Crash]Error Intializing CEGUI (First time)

Postby arkdemon » Sat Mar 15, 2014 10:06

Thank you for answering.
Sorry but the program crashes even before the render function. It crashes on the initialization.
My OS is Windows. I compile with Mingw 4.8.1 and my IDE is Qt Creator and I use CEGUI 0.8.3 and SFML 2.1.
When the window opens, the program crashes: the screen is white and a message appears with written: CEGUI.exe has stopped working. Windows is checking for a solution.
I stripped everything from the code except the initialization process so the code I gave you has no render function but just the initialization. Even if I try the stripped version it crashes at:

Code: Select all

CEGUI::System::create(*myRenderer);

or the boostrapSystem method.
I hope I am clearer.

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

Re: [Crash]Error Intializing CEGUI (First time)

Postby Ident » Sat Mar 15, 2014 10:09

No you are not clearer. Does your development environment not allow you to debug? you should start in debugging mode and see HOW it crashes.

I have no experience with your setup so there is no way i can help you other than you telling me how it crashes and in what code line.
Also did you look at the link i provided?
CrazyEddie: "I don't like GUIs"

arkdemon
Just popping in
Just popping in
Posts: 9
Joined: Fri Mar 14, 2014 20:52

Re: [Crash]Error Intializing CEGUI (First time)

Postby arkdemon » Sat Mar 15, 2014 10:15

Yes I debuuged and it said it crashed at

Code: Select all

CEGUI::System::create(*myRenderer);


I posted the code earlier:

Code: Select all

#include <GL/glew.h>
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
#include <CEGUI/RendererModules/OpenGL/GL3Renderer.h>
#include <CEGUI/RendererModules/OpenGL/GLRenderer.h>
#include <CEGUI/System.h>

int main()
{
  sf::ContextSettings sets(4,4,4,3,3);//Initialize the window
  sf::RenderWindow screen(sf::VideoMode(640, 480), "Hello CEGUI!",sf::Style::Default, sets);
  screen.setVerticalSyncEnabled(true);

  glewExperimental = GL_TRUE;//Initialize GLEW
  GLenum err = glewInit();
  if(err !=  GLEW_OK){
      printf("%s\n", glewGetErrorString(err));
  }
  if(!GLEW_VERSION_3_3){
      printf("OpenGL Version too low\n");
  }

  CEGUI::OpenGLRenderer *myRenderer = &CEGUI::OpenGLRenderer::create();//Initialize CEGUI
  CEGUI::System::create(*myRenderer);//<-- Crashes

  return 0;
}


and it crashes at

Code: Select all

  CEGUI::System::create(*myRenderer);//<-- Crashes}


here are the libs I link:
libCEGUIOpenGLRenderer-0.a and libCEGUIBase-0.a

EDIT: yes I looked at the link but that is in the rendering process not at the initialization process which is where I am.

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

Re: [Crash]Error Intializing CEGUI (First time)

Postby Ident » Sat Mar 15, 2014 10:20

I can only repeat myself in a hopefully clearer way: You need to debug into CEGUI. Did you build and link CEGUI in debug mode? You should be able to debug inside the CEGUI library then, unless your compiler and toolset doesn't allow you this which means that it is total trash and not usable for any sort of serious development. I need to know where it crashes INSIDE CEGUI not INSIDE YOUR OWN CODE otherwise it is absolutely impossible to tell what could cause the problem, I can only guess. You see, I cannot reconstruct your crash from my side. So how should i know what is wrong.
CrazyEddie: "I don't like GUIs"

arkdemon
Just popping in
Just popping in
Posts: 9
Joined: Fri Mar 14, 2014 20:52

Re: [Crash]Error Intializing CEGUI (First time)

Postby arkdemon » Sat Mar 15, 2014 10:23

Oh ok. Sorry I did not understand. I am currently recompiling CEGUI and I will tell you the results.
Thank you for trying to help me.

arkdemon
Just popping in
Just popping in
Posts: 9
Joined: Fri Mar 14, 2014 20:52

Re: Error while intialising CEGUI with SFML

Postby arkdemon » Sat Mar 15, 2014 12:31

It does not seem to work when I compile: it can not find "-lDbgHelp" when building libCEGUIBase-0_d.dll.a

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

Re: Error while intialising CEGUI with SFML

Postby Ident » Sat Mar 15, 2014 12:33

No idea. Try to google for the error to find out what it means.
CrazyEddie: "I don't like GUIs"


Return to “Help”

Who is online

Users browsing this forum: No registered users and 27 guests