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

Author Topic: Access violation reading location  (Read 2109 times)

0 Members and 1 Guest are viewing this topic.

Natan

  • Newbie
  • *
  • Posts: 1
    • View Profile
    • Email
Access violation reading location
« 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;
}
 

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Access violation reading location
« Reply #1 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. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/