lundi 31 juillet 2017

'thread' is not a member of 'std' in Eclipse Neon with MinGW 6.3 GCC on Windows

I am receiving the error "thread is not a member of std". I have tried every solution that I found online and none have worked so far. I have tried adding -pthread and -std=c++11 to the compiler and linker options and the compiler specs, as well as setting the language standard to ISO C++11. I am using Eclipse neon.3 with minGW 6.3.0-1, and I have updated all of my packages.

The code does run, but I would like to get rid of the error if possible.

Do I need a different version of mingw? Should I just switch to mingw-w64?

Here is my toolchain, for reference:

GCC Assembler

GCC Archiver

GCC C++ Compiler

GCC C Compiler

MinGW C Linker

MinGW C++ Linker

And the simple code that gives this error:

#include <thread>
#include <iostream>

void call_from_thread() {
    std::cout << "Hello!" << std::endl;
}

int main() {
    std::thread t1(call_from_thread);
    return 0;
}

Aucun commentaire:

Enregistrer un commentaire