0

I've installed MinGW(gcc 6.3.0) and Eclipse 4.7 on Windows 8.1. I could compile and run other programs without any issue. But when I was using thread it is showing that thread was not declared in this scope. I've tried this and this but both no avail. Could somebody help me fix this? Here is the code I've treid.

#include <iostream>
#include <thread>

void foo(){
    std::cout<<"thread function \n";}

int main(void)
{
    std::thread t1(foo);
    t1.join();
    return 0;
}

I'm not sure about the C++11 features. I've tried Lambda function example from this page(last example) and it is working fine.

Naveen Kumar
  • 325
  • 1
  • 3
  • 14

0 Answers0