I've been having an error declaring a thread class object. I tried this code and it gave me the error "'thread' was not declared in this scope". If it helps, I'm compiling to Windows using MinGW GCC.
#include <iostream>
#include <thread>
using namespace std;
void func(){
cout << "Hello from thread 2\n";
}
int main(){
cout << "Hello from thread 1\n";
thread t2(func);
t2.join();
return 0;
}
Compiling gives me "error: 'thread' was not declared in this scope
"