thread library not included in minGW?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

#include <iostream>
#include <string>
#include <ctime>
#include <cstdlib>
#include <thread>

using namespace std;


int tickNum;

int ticker(clock_t tick, int tickRate, int tickNum) {
clock_t start_time = clock();
clock_t end_time = tick * tickRate + start_time;
while(clock() <= end_time) {
cout << endl << tickNum <<" tick(s) passed" << endl;
tickNum++;
}
return 0;
}

int input () {
string plInput;
cin >> plInput;

}

int main () {
std::thread threadTicker (ticker);
std::thread threadInput (input);

return 0;
}



lines 30 and 31 are saying thread is not a member of std, and also that ; is expected before threadTicker/threadInput.

I am using minGW with code::blocks and have [-std=c++11] enabled through ide options.
Last edited on
when I right click on #include <threads> in code::blocks the file does exist on my computer, why won't it work? is my syntax wrong on lines 30 and 31?
Last edited on
Topic archived. No new replies allowed.