I'm trying to load a texture in SFML, however if I run the program, it throws the access violation exception. In relation to this I've already looked at this post, but since noone has answered that, I still have no idea what's wrong.
I'm developing on a Win10 PC with Visual Studio 2017 installed. I've already tried changing the location of the files and even putting the files into the debug folders.
#include <SFML/Graphics.hpp>
int main()
{
sf::Image image;
if (!image.loadFromFile("board.png"))
{
return -1;
}
}
I expect the program to load the image from the file into memory, instead Visual Studio shows me this exception:
Exception raised at 0x716C2CE7 (vcruntime140.dll) in Chess.exe: 0xC0000005: Access violation reading location 0x00700000.
User contributions licensed under CC BY-SA 3.0