问题描述
在MinGW中使用g ++ 4.5.2进行编译时,是否仍要在Windows中使用C ++ 11标准库中的std::thread
?
Is there anyway to use std::thread
with C++11 standard library in windows when compiling with g++ 4.5.2 in MinGW?
我将假设不",因为我已经看到很多事情说您必须使用pthreads选项进行编译,但我想无论如何我都会问.
I'm going assume no as I've seen many things saying you have to compile with the pthreads option but I figure I'd ask anyway.
推荐答案
MinGW-w64工具链中的std::thread
具有实验性支持.
There is experimental support for std::thread
in for MinGW-w64 toolchains.
具体地说,我的GCC 4.6版本通过MinGW-w64的winpthreads库提供了可用的std::thread
.
Specifically, my GCC 4.6 builds provide usable std::thread
through MinGW-w64's winpthreads library.
您可以在这里找到下载内容:
You can find downloads here:
- 64-bit.
- 32-bit.
除此之外,MSVC11(Visual Studio 2012)具有<thread>
,<chrono>
和<atomic>
.您可以在此处下载.
Apart from that, MSVC11 (Visual Studio 2012) has <thread>
, <chrono>
, and <atomic>
. You can download the Express edition here.
这篇关于Windows上的C ++ 11线程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!