You should associate it with pthread :
g++ -o thread_test thread_test.cpp -std=c++0x -lpthread
For implementation
libstdc++ std::thread needs to associate applications with libpthread , otherwise they will throw std::system_error when trying to create a thread.
source share