Build issues

Started by Snarky, 24 December 2018, 23:51:10

Snarky

Whenever I try to build the following code:
#include <TGUI/TGUI.hpp>

int main()
{
    sf::RenderWindow window{{800, 600}, "Window"};
    tgui::Gui gui{window};

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

            gui.handleEvent(event);
        }

        window.clear();
        gui.draw();
        window.display();
    }

    return EXIT_SUCCESS;
}

Which came from the TGUI Minimal code tutorial for version 0.8, I get the following errors for 7 lines in the SignalImpl.hpp:
  • expected primary-expression before 'auto'
  • expected ')' before 'auto'
  • expected unqualified-id before 'decltype'
I also get 2 warnings about lambda capture initializers only available in -std=c++14 or -std=gnu++14 even though I have compile with that standard on in build options. I get the same warning in MenuBar.hpp.
What should I do (if I can do anything)?

texus

What compiler are you using?

QuoteI also get 2 warnings about lambda capture initializers only available in -std=c++14 or -std=gnu++14 even though I have compile with that standard on in build options
Maybe you enabled that option but it gets a -std=c++11 option from somewhere else which overrides it?
Can you show the command passed to the compiler (e.g. in CodeBlocks this can be found in the "Build log" tab, at least after changing the logging settings as described at https://www.sfml-dev.org/faq.php#tr-grl-verbose-ide)?

Snarky

I use the GNU GCC compiler.
I looked at the Build log and it said I was using the -std=c++11 option so I looked in compiler settings and in there it was ticked instead of -std=c++14 so I changed it and it built correctly. Thanks again.