Finds std::threads. What's wrong?

C::B does not find the thread. In the compilation settings (project>>build options and settings>>compiler) prescribed the use of C++14 (thread s are allowed with C++11).
Code that looks like this:
#include <thread>
using namespace std;
void doIt(){
 //do nothing
}
int main(){
 thread t(doIt);
t.detach();
 return 0;
}</thread>

In what could be the problem? I understand that my question is likely silly, but we always with something to start with...

PS In VS 2017 somehow another problem... "No such constructor, so in the parameters there was only a void-function". (Using C++14 similarly ordered)
June 3rd 19 at 19:27
1 answer
June 3rd 19 at 19:29
Finds std::threads. What's wrong?

Who does not find? What is the error message?
Here is what I see:
$ cat > thr.cpp
#include <thread>
using namespace std;
void doIt(){
 //do nothing
}
int main(){
 thread t(doIt);
t.detach();
 return 0;
}
$ g++ -std=c++11 thr.cpp -o thr
/tmp/ccVyziLM.o: In function `std::thread::thread<void (&)()>(void (&)())':
thr.cpp:(.text._ZNSt6threadC2IRFvvEJEEEOT_DpOT0_[_ZNSt6threadC5IRFvvEJEEEOT_DpOT0_]+0x20): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status</void></thread>

Treated key -pthread:
$ g++ -std=c++11 thr.cpp -pthread -o thr
Not cured :(
The error corresponds to the title: "error: 'thread' was not declared in this scope". If you take a std, it turns out "is not a std" ("error: 'thread' is not a member of 'std'"). Ordered this flag, the error is different.... In short, it does not see it. If he's just in a class description no. While #include is spelled out (in arguing that this header do not). - adelle.Fay commented on June 3rd 19 at 19:32

Find more questions by tags C++Code::Blocks