Possible Duplicate:
How to enable experimental C++0x concurrency features in MinGW?
TDM-GCC complains with error: 't开发者_JS百科hread' is not a member of 'std'
when building with g++ test.cpp -std=c++0x
This came from a forum conversation:
Question: is the level of c++0x support the same as in the linux gcc versions?
Almost but not quite. Support for std::thread currently relies on POSIX threads in libstdc++, which will require a configuration change at least. I haven't tried it yet. Most other C++0x features should work.
The closest I can get to a documented response is the libstdc++ documentation on C++11 support, which states that at time of writing support for class thread
is "partial". It seems likely, if support in mainline GCC isn't done yet, that support in the TDM port is at best partial and at worst non-existent.
This MinGW mailing list post is somewhat more precise in its analysis of the situation as it stands now.
I'd recommend using boost::thread
for now, for an easy switch-over in a few months' time.
TDM GCC does not support std::thread
out of the box at the moment. My (commercial) Just::Thread library provides an implementation of std::thread
for several compilers and platforms, including TDM GCC 4.5.2 on Windows.
精彩评论