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

Author Topic: Problem running applications made with SFML  (Read 1411 times)

0 Members and 1 Guest are viewing this topic.

RedChu

  • Newbie
  • *
  • Posts: 1
    • MSN Messenger - rccd@live.com
    • View Profile
Problem running applications made with SFML
« on: March 18, 2011, 01:48:38 am »
I am using Visual Studio 2010/2008 (I switched to 2008 for reasons being that it wouldn't work in 2010) on Windows Vista Home Premium 32-bit.

I'm currently doing the window creation tutorial with SFML version 1.5, and it's compiling fine with no warnings or errors, but when running it, it opens the window and then crashes and says that DEP (Data Execution Protection or whatever) stopped it from executing.

People running the exe made upon compiling on Windows 7 says it runs without any problems, so I'm assuming that it is a problem with Vista.

Debugging points to App.Display() as the problem, or rather, the closing bracket of the while loop.

Quote
First-chance exception at 0x050a64c0 in WindowCreation.exe: 0xC0000005: Access violation.
Unhandled exception at 0x050a64c0 in WindowCreation.exe: 0xC0000005: Access violation.
The program '[1704] WindowCreation.exe: Native' has exited with code -1073741819 (0xc0000005).
That is the output in the debugger.

Code: [Select]
#include <SFML\Window.hpp>

int main()
{
sf::Window App(sf::VideoMode(800, 600), "Window Caption");

bool running = true;
while(running)
{
App.Display();
}

return EXIT_SUCCESS;
}
That is the code that I am attempting to run.

As I said, it compiles fine with no errors or warnings, but it crashes when ran. I assume it's because of DEP, but I don't see why I'm any different than anyone else who runs Vista that uses SFML (or maybe no one else does?)

Hopefully one of you knows the reason why it's doing this, or know how to fix it.

Also, it does this for both 1.5 and 1.6. And if I run a program made by someone else with SFML, it does the same exact thing... perhaps this isn't the right place to ask this question but it's just bothering me not knowing why it's doing this, plus I want to know if anyone else that uses Vista has this problem.

Edit: I fixed the problem.

Project Properties -> Linker -> Advanced -> Data Execution Prevention (DEP) : /NXCOMPAT:NO

That stops DEP from closing the program.

 

anything