SFML community forums

Help => General => Topic started by: nelsk on March 17, 2013, 04:14:45 am

Title: Texture.loadFromFile crashing due to access violation?
Post by: nelsk on March 17, 2013, 04:14:45 am
Hi folks,

Just fired up SFML2 again and I'm suddenly getting a hard crash when trying to load a texture from a file?

        sf::RenderWindow window(sf::VideoMode(800, 600), "SFML Window");

        sf::Texture t;
        if(!t.loadFromFile("Sheet.png")) // Access violation - CRASH!
                return EXIT_FAILURE;

Am I missing something here? Wondering if it has something to do with the libs.
I'm on Windows 7 64bit with VS2010 running in Debug. I'm using the pre-built SFML2 RC off the download page, linking against sfml-*.lib and setting my working dir to ../SFML2/bin.

Anything obvious I'm missing?

Edit: I've also noticed the title of my RenderWindow is junk - not what I've set it too. Is it not initializing correctly for some reason?
Title: Re: Texture.loadFromFile crashing due to access violation?
Post by: Laurent on March 17, 2013, 09:12:29 am
You must link to debug libraries (sfml-*-d.lib) in debug configuration.
Title: Re: Texture.loadFromFile crashing due to access violation?
Post by: Kiecker on May 17, 2016, 07:43:37 am
I have linked all the libs included in the download off the official page and haven't had any luck on this subject either. I have an image loaded in my project I am doing loadFromFile() and it will hard crash my computer
Title: Re: Texture.loadFromFile crashing due to access violation?
Post by: Laurent on May 17, 2016, 08:05:32 am
Quote
I have linked all the libs included in the download off the official page
You must not link all the libraries, only those that match your build settings.