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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - pennywise881

Pages: [1]
1
Graphics / Texture.loadFromFile("") error
« on: March 07, 2018, 11:44:27 am »
Hi there, i cant make a sprite sheet appear on my game screen. I am using codeblocks as my IDE and the way I am trying to achieve it is by doing this:
int main()
{
    gameWindow.create(sf::VideoMode(1000,800),"My Game",sf::Style::Titlebar | sf::Style::Close);
    sf::Texture pTexture;
    sf::Sprite playerImage;
    pTexture.loadFromFile("Player.png");//this is where i am getting the error
    playerImage.setTexture(pTexture);

    while(gameWindow.isOpen())
    {
        while(gameWindow.pollEvent(event))
        {
            if(event.type==sf::Event::Closed)gameWindow.close();
        }

        gameWindow.draw(playerImage);
        gameWindow.display();
    }
}
the error in the logs is this : "undefined reference to `_imp___ZN2sf7Texture12loadFromFileERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS_4RectIiEE'"

Any help is appreciated

Pages: [1]