Elemenope
Elemenope

Reputation: 9

SFML Load From File Finishes With Error Code

I am currently taking my first steps with SFML and am continuously running into a problem. My code compiles, but when it is time to load an image, the program crashes with an exit code. Below is a code example I took directly from an official SFML tutorial.

I checked, and my image is in the correct working directory and can be found by SFML. I have also tried with multiple images and .png/.jpg but nothing has worked so far.

    int main()
{
    sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");
    sf::Image texture;
    //error happens here
    if (!texture.loadFromFile("image.jpg")){ 

        return EXIT_FAILURE;
    }

Thank you for any hint/help!

Upvotes: 0

Views: 45

Answers (0)

Related Questions