SFML community forums

Help => Graphics => Topic started by: OverMath on June 15, 2020, 09:28:35 am

Title: [SOLVED]Failed to load image without reasons
Post by: OverMath 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