Meaning of options in mingw-w64 installer

风格不统一 提交于 2019-11-28 03:49:05
ollo

Exceptions

Please see this answer for all three models (dwarf, sjlj and seh).

Threads

You can decide what kind of threads you want to use: POSIX threads or Windows API threads. The posix threads have the advantage of portability; you can use your code on other posix platforms (eg. linux) without modifications. The win32 threading api is windows only. If you are 100% on windows and like it's api that's no problem though.

If you use new C++ features like std::thread the impact is less visible since you already have a standard api for threading. I'm not sure if there's really a big difference if you don't use posix- / win32 thread api directly (maybe std::thread native handles?)

See also: mingw-w64 threads: posix vs win32

Build revision

I guess that's just another version number since Mingw(-w64) follows GCC versions (4.8.x, 4.9.x etc.). If you don't need an specific build, you should use the latest version.

Threading issue

If the exception thrown is:

terminate called after throwing an instance of 'std::system_error'
  what():  Enable multithreading to use std::thread: Operation not permitted

then just link pthreads - and the problem is solved.


Recommendation

If you don't have reasons to use a specific option; my personal recommendation:

posix - dwarf - 2
  • Posix enable C++11 <thread>, <mutex> and <future>
  • dwarf is faster
  • 2 because it's the latest release
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!