1
Graphics / [SOLVED] LoadFromFile Crash
« on: May 20, 2013, 12:35:50 am »
Hey guys!
I have been having particular trouble loading an image. It's never given me trouble before, but now it is.
I have checked to use the correct versions of the library. I am using the pre-compiled VS2012 version of the SDK. I am linking Debug libraries to my Debug project.
I couldn't produce a smaller version of the error. I first created a test program to test and see if it was SFML messing up. Just as I predicted, SFML was not the problem and it is my own doing. Since then, I have not been able to locate the error.
This code managed to gather the correct source from the XML file, so we can rule out the TinyXML code. I debugged the crash and it occurs directly on the line with the loadFromFile() call. It doesn't send a fail to SFML either because it never gets inside of the if statement or even past it.
The error says:
Unhandled exception at 0x0FB5CCC8 (msvcp110d.dll) in sf_tile_engine.exe: 0xC0000005: Access violation reading location 0x51DF2948.
The call stack says:
> msvcp110d.dll!std::_Container_base12::_Orphan_all() Line 216
> sfml-graphics-d-2.dll!0ff5dd9a()
> [Frames below may be incorrect and/or missing, no symbols loaded for sfml-graphics-d-2.dll]
> sfml-graphics-d-2.dll!0ff63ea4()
> sfml-graphics-d-2.dll!0ff629b9()
> sf_tile_engine.exe!sftile::SfTileset::Parse(tinyxml2::XMLElement * _element) Line 74 // This is the function that contains the above code.
Any hints?
PS: The image it's trying to load is indeed in the directory and of the type PNG.
Thanks!
I have been having particular trouble loading an image. It's never given me trouble before, but now it is.
I have checked to use the correct versions of the library. I am using the pre-compiled VS2012 version of the SDK. I am linking Debug libraries to my Debug project.
I couldn't produce a smaller version of the error. I first created a test program to test and see if it was SFML messing up. Just as I predicted, SFML was not the problem and it is my own doing. Since then, I have not been able to locate the error.
// Load the image of the tileset and store
// it in the SfTileset.
string source = "tmw_desert_spacing.png";
cout << source << endl;
if (!tileset_image.loadFromFile(source))
{
cout << "Failed to load tileset image" << endl;
return false;
}
cout << "Success" << endl;
// it in the SfTileset.
string source = "tmw_desert_spacing.png";
cout << source << endl;
if (!tileset_image.loadFromFile(source))
{
cout << "Failed to load tileset image" << endl;
return false;
}
cout << "Success" << endl;
The error says:
Unhandled exception at 0x0FB5CCC8 (msvcp110d.dll) in sf_tile_engine.exe: 0xC0000005: Access violation reading location 0x51DF2948.
The call stack says:
> msvcp110d.dll!std::_Container_base12::_Orphan_all() Line 216
> sfml-graphics-d-2.dll!0ff5dd9a()
> [Frames below may be incorrect and/or missing, no symbols loaded for sfml-graphics-d-2.dll]
> sfml-graphics-d-2.dll!0ff63ea4()
> sfml-graphics-d-2.dll!0ff629b9()
> sf_tile_engine.exe!sftile::SfTileset::Parse(tinyxml2::XMLElement * _element) Line 74 // This is the function that contains the above code.
Any hints?
PS: The image it's trying to load is indeed in the directory and of the type PNG.
Thanks!