The docs say this code should return false if loading fails, but instead I get the following error:
#include <SFML/Graphics>
int main(){
sf::Texture tex;
if(!tex.loadFromFile("Player.png"))//exception thrown here
return -1;
}
Exception thrown at 0x564D334D (vcruntime140.dll) in My Project.exe:
0xC0000005: Access violation reading location 0x004C4000.
I'm using the .dll method as explained in the tutorials how to setup SFML for Visual Studio 2019. SFML version 2.5.1-x86.
When I comment out the line my game runs fine. If I pass it an empty string or put/remove the .png file from the working directory it still raises the exception.