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

Author Topic: Unhandled exception at 0x759a9f11 in sfml-test.exe  (Read 2196 times)

0 Members and 1 Guest are viewing this topic.

garman

  • Newbie
  • *
  • Posts: 6
    • View Profile
Unhandled exception at 0x759a9f11 in sfml-test.exe
« on: December 29, 2010, 01:21:51 am »
Hello. I'm new to SFML. I'm trying to use Window to create a simple window as a test. Here's my code:

Code: [Select]
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
#include <iostream>

int main(int argc, char** argv)
{
    sf::Window App(sf::VideoMode(800, 600, 32), "test");
    return 0;
}


It compiles just fine, I've linked the -d lib files (it's compiling in Debug Win32 mode), and I even got it to work earlier (a window would appear for a second but then it would crash). I do NOT have any dll files in any of the project folders (not sure where they should go, anyway - the instructions in the tutorial are ambiguous as there are many sets of Release and Debug folders in the project folder). Also, earlier, when the window popped up, there were no dlls in the project folder.

I get the following run-time error: Unhandled exception at 0x759a9f11 in sfml-test.exe: 0xC0000005: Access violation reading location 0xcccccc00. It points to line 7 (sf:: Window App...). I'd like some help. Thanks in advance.

P.S. I'm using VS 2010. I'm basically getting the same error this guy is: http://www.sfml-dev.org/forum/viewtopic.php?t=3152&sid=46ad47e735ac133493ab73e5f4540f4b
Also, the clock program worked, and iirc, I compiled the source for VS 2010, so that shouldn't be a problem.

Could I be missing something from the SFML-1.6 or lib/vc2010 folder? I don't think I am... Do I have to put the dlls in the project folder?

EDIT: I put the DLLs in the project folder, and it's working with the Release version (I'll try the Debug version later). However, I'm now getting a buffer overrun error:

Code: [Select]
A buffer overrun has occurred in sfml-test.exe which has corrupted the program's internal state. Press Break to debug the program or Continue to terminate the program.

For more details please see Help topic 'How to debug Buffer Overrun Issues'.

NorthernGate

  • Newbie
  • *
  • Posts: 10
    • View Profile
Unhandled exception at 0x759a9f11 in sfml-test.exe
« Reply #1 on: December 29, 2010, 03:47:47 am »
If I'm not mistaken it's going to crash because you haven't setup the event receiver for your window, just add this to your code.

Code: [Select]

sf::Event Event;

while(App.IsOpened())
{
    while(App.GetEvent(Event))
    {
        if(Event.Type == Event.Closed) App.Close();
    }

    App.Clear();
    App.Display();
}


It should work, but I can't make any guarantees, hope this helped.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Unhandled exception at 0x759a9f11 in sfml-test.exe
« Reply #2 on: December 29, 2010, 08:16:17 am »
You have to recompile SFML, VC2008 libraries are not compatible with VC2010.
Laurent Gomila - SFML developer

garman

  • Newbie
  • *
  • Posts: 6
    • View Profile
Unhandled exception at 0x759a9f11 in sfml-test.exe
« Reply #3 on: December 29, 2010, 03:04:01 pm »
SFML.sln only has the sfml- projects, so I'm pretty sure I've already compiled everything...

It seems to be working now.

 

anything