I wanted to create a program where I can call multiple threads. I started using #include <thread>
but since it did not worked I followed the instructions from std::thread error (thread not member of std). Now my program looks like
#include <iostream>
#include "PATH/mingw.thread.h"
void task1(std::string msg)
{
std::cout << "task1 says: " << msg;
}
int main() {
std::thread t1(task1, "Hello from thread 1");
std::thread t1(task1, "Hello from thread 2");
}
When I run this I get the following error in Visual Studio Code: fatal error C1189: #error: A C++11 compiler is required!
Also when I type g++ program.cpp -o programm, I get a long text of errors.
What can I do to fix this? Many thanks in advance