[MinGW-Users] std::thread support

アーカイブの一覧に戻る
Anton Shepelev anton****@gmail*****
Tue Dec 22 19:40:19 JST 2020


Hello, all

Does the lastest (9.2.0) MinGW release of GCC not support
std:thread?  When I try co compile the following program:

#include <thread>
int main( void )
{  std::thread* hunk_thread;
   return 0;
}

with gcc -std=c++11, the compiler compains thus:

test.cpp: In function 'int main()':
test.cpp:3:8: error: 'thread' is not a member of 'std'
    3 | { std::thread* hunk_thread;
      |        ^~~~~~
test.cpp:2:1: note: 'std::thread' is defined in header '<thread>';
              did you forget to '#include <thread>'?
    1 | #include <thread>
  +++ |+#include <thread>
    2 | int main( void )
test.cpp:3:16: error: 'hunk_thread' was not declared in this scope
    3 | { std::thread* hunk_thread;

I then found a project on Github advertised as:
"Implementation of standard C++11 threading classes, which
are currently still missing on MinGW GCC.":

   https://github.com/meganz/mingw-std-threads

With the lastest updates from 2020. Maybe be MinGW could use
their sources either directly or for consultation for
implementing threads.



More information about the MinGW-Users mailing list
アーカイブの一覧に戻る