I have bee trying to figure out why for ages now. But if i try to load a file from the disk (both for image and texture) and i just get an unhandled exception.
This is the code:
#include <SFML/Graphics.hpp>
#include <Windows.h>
int main()
{
sf::RenderWindow window(sf::VideoMode(1024, 768), "SFML works!");
sf::Text text("Hello SFML");
sf::Texture texture;
texture.loadFromFile("dude.jpg");
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
window.clear();
window.draw(text);
window.display();
}
TerminateProcess(GetCurrentProcess(), EXIT_SUCCESS);
}
After some searching I thought maybe recompiling was the answer, but it didn't change a thing =(.
Also i managed to create an image giving it a colour, height and width so it leads me to think that te file is just not being found.
Here is some other relevant stuff:
Exception
Unhandled exception at 0x653a1f34 in SMFLTEST2.exe: 0xC0000005: Access violation reading location 0x00277000.
Callstack
msvcr100.dll!653a1f34()
[Frames below may be incorrect and/or missing, no symbols loaded for msvcr100.dll]
msvcp100.dll!644c1153()
msvcp100.dll!644c2635()
sfml-graphics-2.dll!510e1ca6()
sfml-graphics-2.dll!510f1b17()
sfml-graphics-2.dll!510e5308()
sfml-graphics-2.dll!510fb204()
> SMFLTEST2.exe!main() Line 11 + 0x35 bytes C++
SMFLTEST2.exe!_WinMain@16() + 0x16 bytes C++
SMFLTEST2.exe!__tmainCRTStartup() Line 547 + 0x2c bytes C
SMFLTEST2.exe!WinMainCRTStartup() Line 371 C
kernel32.dll!770d3677()
ntdll.dll!77c99d72()
ntdll.dll!77c99d45()
Gfx card: AMD Radeon 7850 with 12.4 CCC