Code does not compile in C ++ 11

2

I have a common code, more specifically the following:

#include <iostream>
#include <SFML/System.hpp>
#include <SFML/Window/Keyboard.hpp>

namespace thread
{
    void check_key(sf::Keyboard::Key key)
    {
        while(true)
        {
            if(sf::Keyboard::isKeyPressed(key))
            {
                exit(EXIT_SUCCESS);
            }
        }
    }
}

int main()
{
    sf::Thread keycheck(&thread::check_key, sf::Keyboard::Escape);
    keycheck.launch();
    while(true)
        std::cout << "Hello! ";
}

And when I compile in Code :: Blocks, with Wizzard from SFML 2.0, it works correctly (exits when I press ESC). I changed the sf::Thread to std::thread and of course: first I activated C ++ 11. Just to see if it was spinning, I tried to compile. MinGW returned several errors of, for example, ::diftime and other entities only <ctime> . What should I do?

    
asked by anonymous 08.11.2014 / 02:46

1 answer

0

The problem was probably a corrupted file. The solution is to uninstall the compiler and install it again.

    
09.11.2014 / 13:44