Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Texture.loadFromFile crashing due to access violation?  (Read 5638 times)

0 Members and 1 Guest are viewing this topic.

nelsk

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Texture.loadFromFile crashing due to access violation?
« 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?
« Last Edit: March 17, 2013, 04:16:37 am by nelsk »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Texture.loadFromFile crashing due to access violation?
« Reply #1 on: March 17, 2013, 09:12:29 am »
You must link to debug libraries (sfml-*-d.lib) in debug configuration.
Laurent Gomila - SFML developer

Kiecker

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Texture.loadFromFile crashing due to access violation?
« Reply #2 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

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Texture.loadFromFile crashing due to access violation?
« Reply #3 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.
Laurent Gomila - SFML developer

 

anything