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

Author Topic: Switch from 1.6 to 2.0  (Read 2787 times)

0 Members and 1 Guest are viewing this topic.

ResidentBiscuit

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • Email
Switch from 1.6 to 2.0
« on: July 05, 2012, 04:46:31 am »
Hey there, this is my first post here. I've been using SFML for a bit now and so far really enjoy it. Anyway, I just did the switch from 1.6 to 2.0, and ran into an odd issue that I have no idea on.

If a run my program in debug mode, it runs fine until I go to close the SFML window. When I do so, I get a "Test.exe has stopped working... Searching for reason" Windows message (You know how helpful those are -_-). Anyway, after about 30 seconds of it searching for a reason, it gives me an option to debug. I click that and get this:

Quote
An unhandled win32 exception occured in Test.exe[6688]. Just-In-Time debugging this exception failed with the following error: No installed debugging has Just-In-Time debugging enabled. In Visual Studio... Goes on to explain how to get it in VS

This is odd, because I'm not using VS, nor do I even have it installed on my computer actually. I don't know if this is a known issue, or I'm the only one to experience this. If you have any suggestions, I would appreciate it. It doesn't seem to be some terrible thing, but it's annoying that this happens every time I close my program.

EDIT:
I should probably say I'm using Code::Blocks 10.05 and the version of G++ that comes with that.

Thanks,
-Biscuit
« Last Edit: July 05, 2012, 04:54:37 am by ResidentBiscuit »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Switch from 1.6 to 2.0
« Reply #1 on: July 05, 2012, 08:17:53 am »
Hi

Please read this and come back with more details (and especially some code):
http://en.sfml-dev.org/forums/index.php?topic=5559.0

And you should also learn how to use your debugger ;)
Laurent Gomila - SFML developer

Liag

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Re: Switch from 1.6 to 2.0
« Reply #2 on: July 05, 2012, 08:24:58 am »
I'm assuming you use the 2.0 RC. If so, did you get the DW2 or SJLJ download? Default Code::Blocks MinGW g++ uses SJLJ, and it is marked as that on the downloads page, so that is more likely.

The VS error is because you're trying to solve the exception, which Windows tries to start its native debugger for. Quoting MSDN:

Quote from: MSDN
Just-In-Time debugging is a feature that launches the Visual Studio debugger automatically when a program, running outside Visual Studio, encounters a fatal error.

Try checking the call stack instead.

ResidentBiscuit

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • Email
Re: Switch from 1.6 to 2.0
« Reply #3 on: July 05, 2012, 03:15:56 pm »
@Laurent,

Hi I did read that. I used your test code that you have on the setting up page. I did download the RC, and I did get the SJLJ download.

#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow window(sf::VideoMode(300, 200), "SFML works!");
    sf::Text text("Hello SFML");

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }

        window.clear();
        window.draw(text);
        window.display();
    }

    return 0;
}

Generates no build errors, and no real run time errors. The error only comes up when I actually try to close the window. In which case, the error message comes up.

I'm not sure what more info you want. I've checked to make sure things are in order at my end, and I've posted the error message and now the code. I'm not at my computer with the program in question, so I can't really run the debugger on it.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Switch from 1.6 to 2.0
« Reply #4 on: July 05, 2012, 03:34:41 pm »
Please search the known issues before posting: https://github.com/SFML/SFML/issues/59
Laurent Gomila - SFML developer

ResidentBiscuit

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • Email
Re: Switch from 1.6 to 2.0
« Reply #5 on: July 05, 2012, 03:50:49 pm »
Ah I did not search github for this.

Seems as if the fix to this is to just explicitly call getDefaultFont() in the sf::Text constructor?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Switch from 1.6 to 2.0
« Reply #6 on: July 05, 2012, 04:02:18 pm »
No. The only way to avoid the crash is to avoid calling getDefaultFont(), whether explicitely or implicitely. So you have to load your own font, and pass it to the constructor of all your sf::Text.

Or you can link SFML statically.
Laurent Gomila - SFML developer

 

anything