gpt4 book ai didi

windows - Windows 上的 C++11 线程

转载 作者:可可西里 更新时间:2023-11-01 12:41:11 25 4
gpt4 key购买 nike

在 MinGW 中使用 g++ 4.5.2 编译时,是否可以在 Windows 中将 std::thread 与 C++11 标准库一起使用?

我假设没有,因为我看到很多事情都说你必须使用 pthreads 选项进行编译,但我想我还是会问。

最佳答案

有对 std::thread 的实验性支持用于 MinGW-w64 工具链。

具体来说,我的 GCC 4.6 版本提供了可用的 std::thread通过 MinGW-w64 的 winpthreads 库。

您可以在这里找到下载:

除此之外,MSVC11 (Visual Studio 2012) 有 <thread> , <chrono> , 和 <atomic> .您可以下载速成版 here .

关于windows - Windows 上的 C++11 线程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6783512/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com