Access violation writing location 0x00000079 when running code

0

I'm trying to create a simple snake game as an easy first project using SFML in c++, however the program crashes.

I tried redoing all configurations in visual studio and I have tried debugging using stacker. (Don't know how to use it properly so didn't go to well.)

Here is my code:

#include <SFML/Window.hpp> //Loads SFML Windowfile

using namespace std; //Includes sf for Window and VideoMode

int main()
{
    Window window(VideoMode(500,500), "My window"); //Creates a window and assigns it a size and name
        return 0; 
}

I have also tried this code with no success:

#include <SFML/Window.hpp>

int main()
{
    sf::Window window;
    window.create(sf::VideoMode(800, 600), "My window");

    return 0;
}

I expect to get a window that is 500 x 500 pixels but instead I get this error message: "Unhandled exception at 0x000B3062 in Snake3.exe: 0xC0000005: Access violation writing location 0x00000079." and it points me to xmemmory0.

Here's the callstack

c++
visual-studio
sfml
visual-studio-2019
asked on Stack Overflow May 21, 2019 by Jesper Appelberg • edited May 21, 2019 by Jesper Appelberg

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0