SFML community forums
Help => Graphics => Topic started by: dabo on September 30, 2007, 09:36:25 pm
-
I'm trying to load a jpg image (1024x768), there's nothing wrong when I build the project in VS C++ 2005, but when I try to run it this error message shows up:
"Unhandled exception at 0x1023ee40 in first_ex.exe: 0xC0000005: Access violation reading location 0x097f1000."
This is the code I'm using:
sf::Image ImgBgr;
if (!ImgBgr.LoadFromFile("./background2.jpg"))
{
cout << "error loading image." << endl;
return EXIT_FAILURE;
}
sf::Sprite SprBgr(ImgBgr, 0, 0);
App.Draw(SprBgr);
Other images load successfully but this one won't, I've tried other image formats too but nothing works. Any idea what's wrong?
Edit: I forgot to mention that in debug mode, it shows that the problem is on the line where I call the LoadFromFile-function.
-
No idea. Maybe you can send me your source code with the guilty image, so that I can check on my computer.
-
No idea. Maybe you can send me your source code with the guilty image, so that I can check on my computer.
I've sent you a PM with the cpp and the jpg image.
-
I received your files, thanks.
I currently cannot test it, but the code looks good. The only reason I see is a bad version of the DevIL DLL. Make sure you don't have an old one in your system32 folder.
-
I received your files, thanks.
I currently cannot test it, but the code looks good. The only reason I see is a bad version of the DevIL DLL. Make sure you don't have an old one in your system32 folder.
Apparently there was an old DevIL dll in the system32 folder, because when I deleted it the project runs. Before deleting the file I was always getting a message in the console about using an old version.
Thanks a lot Laurent.
-
Glad to see it works :)
-
I'm also having some Image loading troubles since I updated from SVN.
Keep getting "Failed to load image from file "tex16.jpg"."
No DevIL.dll in my system32 folder. :<
-
Put the DevIL.dll int the debug/release folder?
-
Put the DevIL.dll int the debug/release folder?
Yup. Did that.
-
Put the DevIL.dll int the debug/release folder?
Yup. Did that.
Perhaps I forgot to mention that it still doesn't work. :/