Windows上的C ++ 11线程 [英] C++11 threading on Windows

查看:77
本文介绍了Windows上的C ++ 11线程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在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线程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆