mardi 6 février 2018

Can't resolve namespace member 'thread'

I wanted to practice with standard C++ threads instead of UNIX ones, but soon encountered a problem, whenever I write std::thread CLion underlines it with red and says Can't resolve namespace member 'thread'. I checked my CMake file it's set for C++11. I reinstalled the latest version of MinGW (6.3.0) and ticked a box with G++ compiler. I have been told by my friend that he uses Cygwin and everything works. But is it still possible to make it work with MinGW?

#include <iostream>
#include <thread>

#define BUFFER_SIZE 3
#define PROD_NUM 3
#define CONS_NUM 2



void produce(){
    //production
}

void consume(){
    //consumption
}

int main() {
    std::cout << "Hello, World!" << std::endl;
    int i,j;
        std::thread producer(produce);
        std::thread consumer (consume);
    return 0;
}

The code itself has literally nothing

Aucun commentaire:

Enregistrer un commentaire