I think on Linux pthread is used to implement std::thread
so you need to specify the -pthread
compiler option.
As this is a linking option, this compiler option need to be AFTER the source files:
$ g++ -std=c++0x test.cpp -pthread
More Related Contents:
- std::enable_if to conditionally compile a member function
- What happens to a detached thread when main() exits?
- Compiling C++11 with g++
- How does #include work in C++? [duplicate]
- Thread pooling in C++11
- What does the thread_local mean in C++11?
- How to check if a std::thread is still running?
- static_assert fails compilation even though template function is called nowhere
- Does MinGW-w64 support std::thread out of the box when using the Win32 threading model?
- What exactly is std::atomic?
- How would you implement your own reader/writer lock in C++11?
- Mixing C++11 atomics and OpenMP
- 😃 (and other Unicode characters) in identifiers not allowed by g++
- std::unique_lock or std::lock_guard?
- Does the C++ volatile keyword introduce a memory fence?
- How to set the stacksize with C++11 std::thread
- How to give priority to privileged thread in mutex locking?
- What causes runtime error message: std::system_error – operation not permitted, including mult-threading? [duplicate]
- How can I use something like std::vector?
- What is std::promise?
- Passing arguments to std::async by reference fails
- cc1plus: error: unrecognized command line option “-std=c++11” with g++
- C++11 std::threads vs posix threads
- Understanding std::atomic::compare_exchange_weak() in C++11
- std::this_thread::sleep_for() and GCC
- Why can’t I use with g++ 4.9.2?
- Spurious warning about binding temporary to reference member in constructor
- Is substitution performed on a variadic parameter pack type if the pack is empty?
- std::thread calling method of class [duplicate]
- Write concurrently vector