So I started to learn c++ and I come across multithreading, but there is one problem: It gives me the error main.cpp|12|error: 'thread' was not declared in this scope
although I have included the <thread>
library in my code.
I use Code::Blocks and GNU GCC Complier
on Windows.
Here is an example of my code:
#include <iostream>
#include <thread>
using namespace std;
void test(){
cout<<"hello, I am a thread !";
}
int main(){
thread t1(test);
return 0;
}