SFML community forums

Help => Graphics => Topic started by: Natan on February 21, 2021, 10:15:50 am

Title: Access violation reading location
Post by: Natan on February 21, 2021, 10:15:50 am
I have a very simple c++ code with sfml graphics and I'm trying to read an image into Texture using loadFromFile function and when I try to run it with the visual studio debugger I got an exception for reading violation and I have no idea what causes this problem.
Please help!

This is my code:
int main()
{

        sf::Texture texture;

        texture.loadFromFile("girl.png");
        sf::Sprite girl(texture);

        return 0;
}
 
Title: Re: Access violation reading location
Post by: eXpl0it3r on February 22, 2021, 12:04:40 am
You're probably linking 32-bits DLLs while compiling for 64-bits architecture or the other way around.
Or you're using release libraries in debug mode.

Btw. you should always post the full error, because errors aren't just random messages with no meaning. No, they usually tell you exactly what the issue is, as long as you know how to read them. ;)