SFML community forums
Help => Graphics => Topic started by: BM on May 24, 2016, 10:20:56 pm
-
I'm unable to load an image using loadFromFile. I keep getting the following message in the console : "Failed to load image "beach_ball". Reason: Unable to open file".
I made sure the working directory is what I think it is (project Properties -> Configuration Properties -> Debugging -> Working Directory) as well as tried with a full path instead like so : C:/C_FUN/SFML_1_1/SFML_1_1/beach_ball. I tried with different pictures and different type of file (png and jpg).
I double checked to make sure that I was using the proper libraries :-d for debug, no sufix for release.
I'm using windows 7 with VS 2015 and SFML 2.3.2 for Visual C++ 14 (2015) - 64-bit and the project is set to x64.
I've looked around for quite some time before posting this and the main reason was either because the file was not in the right directory or the debug libraries were used for release or vice-versa.
-
Is it really called "beach_ball" and not "beach_ball.jpg" or "beach_ball.png"?
-
Is it really called "beach_ball" and not "beach_ball.jpg" or "beach_ball.png"?
Yes, it's really called "beach_ball". But I did try renaming it with the extension and it still wouldn't work. I also tried with a different path.
-
Let me "bounce" an idea off you. (I'll show myself out... later)
Have you tried Windows Folder Options and confirm that "Hide extensions for known file types" is not checked?
Also if you could just copy and paste the exact Working Directory name you found in Visual Studio here for us to see?
I usually just select the <Browse...> option to see what directory it takes me to.
-
Have you tried Windows Folder Options and confirm that "Hide extensions for known file types" is not checked?
That was the problem. Thanks a lot !
I knew it was going to be something silly...
-
Hey that's awesome, I'm glad my years of otherwise useless corporate existance surfaced something of value!