What MinGW version has std::condition_variable_any, std::thread and std::mutex on Windows?

huangapple go评论59阅读模式
英文:

What MinGW version has std::condition_variable_any, std::thread and std::mutex on Windows?

问题

My MinGW version on my Windows machine that does not have std::condition_variable_any, std::thread and std::mutex so I am getting the following compiler errors:

错误:'std' 命名空间中的 'condition_variable_any' 不是类型
错误:'mutex' 不是 'std' 的成员

I did a quick search and found this page https://github.com/niXman/mingw-builds-binaries/releases where multiple versions are available for Windows. What of them have std::condition_variable_any, std::thread and std::mutex? And what is the key difference between these versions?

英文:

My MinGW version on my Windows machine that does not have std::condition_variable_any, std::thread and std::mutex so I am getting the following compiler errors:

error: 'condition_variable_any' in namespace 'std' does not name a type
error: 'mutex' is not a member of 'std'

I did a quick search and found this page https://github.com/niXman/mingw-builds-binaries/releases where multiple versions are available for Windows. What of them have std::condition_variable_any, std::thread and std::mutex? And what is the key difference between these versions?

答案1

得分: 1

选择POSIX线程构建的GCC/MinGW-w64以获得最佳可移植性。

来自https://winlibs.com/的构建通常使用POSIX线程构建,尽管GCC 13也提供了MCF线程构建,这些构建更接近本机Windows线程,可能也适合您使用。

英文:

For best portability choose POSIX threads builds of GCC/MinGW-w64.

The builds from https://winlibs.com/ are usually built with POSIX threads, though GCC 13 also has MCF thread builds available, which are closer to native Windows threads and may also work for you.

huangapple
  • 本文由 发表于 2023年6月8日 21:16:43
  • 转载请务必保留本文链接:https://go.coder-hub.com/76432261.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定