SFML community forums

Help => General => Topic started by: Optimistic on February 14, 2018, 12:04:09 am

Title: [Solved] Cryptic error when trying to load texture from file
Post by: Optimistic on February 14, 2018, 12:04:09 am
Hey there,
When trying to load a font, compiler tells me:
Code: [Select]
error: passing 'const sf::Texture' as 'this' argument of 'bool sf::Texture::loadFromFile(const string&, const IntRect&)' discards qualifiers [-fpermissive]Here's the offending code:
if(!this->Start_Button_Texture.loadFromFile("StartBTN200x100.png", sf::IntRect(0, 0, 200, 100))){
        //Err
    }

This is the first error the compiler spits out.

By the way, I'm compiling for Android armeabi (Target) on Windows 10 (Host).
Title: Re: Cryptic error when trying to load texture from file
Post by: Optimistic on February 14, 2018, 01:00:14 am
Ooops... Sorry... Can't call non const qualified functions on const objects....