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

Author Topic: Access Violation when running  (Read 3141 times)

0 Members and 2 Guests are viewing this topic.

evilertoaster

  • Newbie
  • *
  • Posts: 9
    • View Profile
Access Violation when running
« on: June 19, 2009, 11:05:19 pm »
I have this same problem on 2 computers trying to get the SFML (1.5) examples to work.

One computer using windows XP SP3 and VS 2005, the other using Windows Server 2008 and VS 2010 (with the 2008 SDK). In both cases I'm using dynamic libraries.

The simple code -
Code: [Select]
#include <SFML/Window.hpp>
int main()
{
sf::Window App(sf::VideoMode(800, 600, 32), "SFML Window");
}

Crashes with the following error in VS2010-
Quote
First-chance exception at 0x76775dbe in SFMLTest.exe: 0xC0000005: Access violation reading location 0x6e695720.
A buffer overrun has occurred in SFMLTest.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'.
The program '[5372] SFMLTest.exe: Native' has exited with code 0 (0x0).


Anyone have an idea what could be wrong?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Access Violation when running
« Reply #1 on: June 19, 2009, 11:31:40 pm »
You're using release libraries in debug mode.
Laurent Gomila - SFML developer

evilertoaster

  • Newbie
  • *
  • Posts: 9
    • View Profile
Access Violation when running
« Reply #2 on: June 19, 2009, 11:47:12 pm »
Hum, I changed VS to release mode and recompiled but it still does the same thing-
Quote
A buffer overrun has occurred in SFMLTest.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'.
The program '[4216] SFMLTest.exe: Native' has exited with code 0 (0x0).


edit: Compiling in Debug mode with the debug libraries does work, but not release mode with the release libraries...

evilertoaster

  • Newbie
  • *
  • Posts: 9
    • View Profile
Access Violation when running
« Reply #3 on: June 20, 2009, 01:07:41 am »
Haven't tried the XP/2005 box yet, but on the 2008/2010 box I found something interesting...
If you go to the property page for the VS project, under the "General" section there is an option for "Platform Toolset". The default option is "v100" but if you change it to "v90" the program runs fine... I'm not sure exactly what this option entails or why it does that...but a warning to VS 2010 users.