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

Author Topic: [SOLVED]Failed to load image without reasons  (Read 1936 times)

0 Members and 1 Guest are viewing this topic.

OverMath

  • Newbie
  • *
  • Posts: 3
    • View Profile
[SOLVED]Failed to load image without reasons
« on: June 15, 2020, 09:28:35 am »
Hi, I'm a beginner with SFML, so I study the tutorial, I try to load an image, but when I try my code, the debugger output and the standard output displays :"Failed to load image "©└icon.png ╠╠╠╠╠╠      ╠╠╠╠╠╠╠╠", so it doesn't help me to understand my problem... I use the EDI Visual Studio, and I know the problem isn't in linkers, I thought to link sfml-xxx.lib and sfml-xxx-d.lib at my project. And my image is in the root of my project, with my main.cpp file. If anyone have an idea to help me...
#include <SFML/Graphics.hpp>

int main()
{
    sf::Texture texture;
    if (!texture.loadFromFile("icon.png"))
        return EXIT_FAILURE;

    return 0;
}
 

PS: Finaly, I found the problem, it was in the linker, I mixed sfml-xxx-.lib and sfml-xxx-d.lib in configurations... Now it works !!  ;D
 
« Last Edit: June 15, 2020, 05:40:16 pm by OverMath »