Runtime error when calling handleEvent() of tgui::Gui
« on: 17 August 2013, 17:22:46 »
Hi,

this might be more of a problem with SFML 2.1, but I didn't have problems when using it without any other libraries, so maybe someone here can help me:

I followed the installation tutorial, copied all resource files to where they should be (I get no error messages when loading the files) and just tried to run the example code from https://tgui.eu/example-code/v06/, but still I get a "First-chance exception" in "sfml-graphics-d-2.dll" in the line "gui.handleEvent(event);".

I am very new to C++ and have no idea how to find a way to understand what is causing this exception, since obviously I cannot jump into the code of SFML or TGUI.

Thanks in advance!

*

texus

  • *****
  • 1161
    • View Profile
    • Texus's Blog
Re: Runtime error when calling handleEvent() of tgui::Gui
« Reply #1 on: 17 August 2013, 17:32:01 »
I never had that problem so I can't immediately tell whats wrong.

Did you download the precompiled version (created only a few hours ago) or did you compile tgui yourself?
Which compiler are u using?

Maybe you are linking to the release version of tgui while linking to the debug version of sfml?

Edit: Does the 'first chance exception' says what type of exception?
« Last Edit: 17 August 2013, 17:33:41 by texus »

Re: Runtime error when calling handleEvent() of tgui::Gui
« Reply #2 on: 17 August 2013, 17:38:54 »
Wow, that was a quick answer!

To answer your questions:

I'm using the version "TGUI v0.6 alpha1 (with precompiled Visual C++ 11 (2012) 32 bits libraries for SFML 2.1", and I just redownloaded SFML 2.1 binaries, for the same version of Visual C++ 11, recopied all DLLs, checked that I'm linking the right versions of the libraries and recompiled. Strangely enough, I now get beyond the handleEvent() line, but get a first chance exception (access violation at the suspicious adress 0xABABABAB) in the line clearWindow() (commenting it out I get the same exception one line below, in window.display().


*

texus

  • *****
  • 1161
    • View Profile
    • Texus's Blog
Re: Runtime error when calling handleEvent() of tgui::Gui
« Reply #3 on: 17 August 2013, 17:54:23 »
You could try following the CMake tutorial and compile the library yourself. It is possible that I messed up the precompiled lib (if I think of it, I used the latest sfml headers but the sfml 2.1 libraries).

I am trying to test the libraries myself right now, but all I get are opengl errors so I'm going to reinstall my graphics driver first (not sure if thats going to help much though).

Re: Runtime error when calling handleEvent() of tgui::Gui
« Reply #4 on: 17 August 2013, 18:07:47 »
Just for the sake of it I created a new empty project with clean settings (in the previous project I already tested some SFML stuff and might have changed something) but the error remains exactly the same. I honestly don't think that it's an issue with TGUI anymore, since all calls should be within the SFML code, but then again I might be wrong :)

Thanks for your (exceptionally quick) help!

Edit: On the other hand, every SFML example I try in the same project works. What makes me wonder is why I can't debug-step into the SFML and TGUI codes, I thought that's what the debug libraries are for? It always says missing PDB files...
« Last Edit: 17 August 2013, 18:13:02 by RotateMe »

*

texus

  • *****
  • 1161
    • View Profile
    • Texus's Blog
Re: Runtime error when calling handleEvent() of tgui::Gui
« Reply #5 on: 17 August 2013, 18:36:04 »
You need the pdb files in order to debug the library, but I don't distribute them (neither does sfml). You only get these when you compile tgui yourself.

On windows the debug libraries aren't just made for debugging the library. You need debug libraries when you compile your own program in debug mode. It is more logical on linux where debug libraries are indeed only needed for debugging the library itself, and in all other situations you can just use the release lib.

Try with commenting out parts of your code, try using only sfml code but still linking to tgui and then add the tgui code again bit by bit. See where it goes wrong.

I hate windows, I can't even get my own library working. I either get tons of opengl errors, or a crash on exit, but it just won't work anymore and I don't even get the exception like you do.

Edit: The pdb file can be downloaded here.
« Last Edit: 17 August 2013, 18:39:35 by texus »

Re: Runtime error when calling handleEvent() of tgui::Gui
« Reply #6 on: 19 August 2013, 11:13:40 »
So I tested linking tgui but using only sfml code, which worked (I tried a lot of funny stuff). I'm going to compile both tgui and sfml, get the pdb files (is there a reason they aren't generally distributed?), and find out what's wrong. Then I'll get back to you.

*

texus

  • *****
  • 1161
    • View Profile
    • Texus's Blog
Re: Runtime error when calling handleEvent() of tgui::Gui
« Reply #7 on: 19 August 2013, 11:20:37 »
Quote
is there a reason they aren't generally distributed?
They are almost as big as the library itself.
In the case of tgui the difference won't be very big, but if sfml would provide pdb files then the download would become a lot bigger.
I'm just not distributing them because sfml doesn't do it.