C++ 多线程不能通过编译问题('thread' is not a member of 'std')

 #include <iostream>
#include <thread>
using namespace std;

void thread_task()
{
    std::cout << "hello thread" << std::endl;
}

int main(int argc, const char *argv[])
{
    std::thread t(thread_task);
    t.join();
    return EXIT_SUCCESS;
}

错误信息:
'thread' is not a member of 'std'|

环境如下:
windows 7 64 bit;

gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/i686-pc-mingw32/6.1.0/lto-wrapper.exe
Target: i686-pc-mingw32
Configured with: ../configure --prefix=/mingw/opt/gcc --with-local-prefix=/mingw/opt/gcc --with-native-system-header-dir=/mingw/opt/gcc/i686-pc-mingw32/include --with-gxx-include-dir=/mingw/opt/gcc/i686-pc-mingw32/include/c++/6.1.0 --target=i686-pc-mingw32 --enable-languages=c,c++,fortran,java,objc,obj-c++ --enable-static --enable-shared --enable-libgomp --enable-lto --enable-threads=posix --enable-libstdcxx --enable-libstdcxx-debug --enable-graphite --enable-tls --enable-nls --disable-bootstrap --disable-stage1-checking --disable-multilib --disable-libvtv --disable-sjlj-exceptions --disable-libstdcxx-pch --disable-win32-registry --with-dwarf2 --with-gmp=/mingw/opt/gcc --with-mpfr=/mingw/opt/gcc --with-mpc=/mingw/opt/gcc --with-isl=/mingw/opt/gcc
Thread model: posix
gcc version 6.1.0 (GCC)

IDE:codeBlocks 16.10

图片说明

C++11才支持的,大多数C++编译器都不支持。。
这么新的东东其实没什么实用价值

gcc版本低了。最好到linux平台用最新的gcx6是可以的

C++11对多线程操作进行了整合封装

这是C++11的特性, linux下gcc版本最好在4.8.1以上, 编译时记得带上-std=c++11。windows下VS版本最少要VS2012, vs越新越好.

升级下你的gcc版本,我用vs13过了

std是标准命名空间
不清楚using namespace std么
还有使用线程需要调用库 -lpthread