Build issues

  • 2 Replies
  • 290 Views
Build issues
« on: 24 December 2018, 23:51:10 »
Whenever I try to build the following code:
Code: [Select]
#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

  • *****
  • 1480
    • View Profile
    • Texus's Blog
Re: Build issues
« Reply #1 on: 25 December 2018, 10:01:59 »
What compiler are you using?

Quote
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
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)?

Re: Build issues
« Reply #2 on: 25 December 2018, 23:26:49 »
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.