2
« on: November 24, 2008, 01:44:41 pm »
Hi at all,
I'm new to SFML and trying to make a small Pong game with it.
There is only one problem:
I try to load an Image this way:
sf::Image image;
if(!image.LoadFromFile("test.png"))
return EXIT_FAILURE;
But LoadFromFile always returns false and the program exits with
Failed to load image "test.png". Reason: can't fopen
Now I tried
if(!image.LoadFromFile("/test.png"))
if(!image.LoadFromFile("./test.png"))
but this doesn't work, too.
The picture is definitely in the same folder as the exe.
Finally I tried this:
sf::Image image;
if(!image.LoadFromFile("C:/test/test.png"))
return EXIT_FAILURE;
So an absolute path works, but not a relative path.
The samples and the tutorials use relative paths and I could not find a solution to this problem in the forum and using google.
Now I would like to ask if this is a "bug" or a "feature" :wink:.
PS: Sorry for bad English, but I'm German and not very good in languages.