mingw-w64安装程序中选项的含义 [英] Meaning of options in mingw-w64 installer

查看:1237
本文介绍了mingw-w64安装程序中选项的含义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在MinGW-W64在线安装程序中,您可以选择几个字段。然而,我找不到任何文档,我所做的猜测并没有给我想要的行为。



显然,很多工作已经进入项目,因此缺乏基本文件,阻碍了这一举措似乎令人遗憾。



版本和架构字段不言自明,但我遇到的其他字段(以当前安装程序显示的值):




  • 线程,选项 posix win32

  • 异常,选项矮人 sjlj

  • 构建版本,选项 0 1 2



在我以前的安装中选择了 win32 seh 1 (显然这些选项自那时以来已经改变了,但我并不明白什么是什么)。

每个选项的优点和缺点是什么,特别是线程模型和异常处理和哪个版本是最好的?

使用 x86_64-win32-seh-rev1 $ b $ ul

  • std :: thread 和<$ c $不支持c> std :: condition_variable
  • 在调试时(使用Code :: Blocks作为IDE),如果抛出异常,它不会跳转到异常处理器;选择下一行不执行任何操作3次,然后放弃执行。


    我可以应付调试问题,但它对于有工作的C ++ 11线程。

    解决方案

    异常



    请请参阅针对所有三种模型(矮人, sjlj和seh)

    线程



    您可以决定想要的线程类型使用:POSIX线程或Windows API线程。 posix线程具有可移植性的优点;你可以在没有修改的情况下在其他posix平台(例如linux)上使用你的代码。 win32线程API仅适用于Windows。如果你在windows上是100%,并且像api那样,那也没有问题。



    如果你使用新的C ++特性,比如 std :: thread 因为你已经有了一个标准的线程API,所以这个影响不太明显。我不确定如果你不直接使用posix- / win32线程API(也许 std :: thread native句柄?),那么它是否真的有很大的不同?



    另请参阅: mingw-w64线程: posix vs win32



    构建版本



    我猜这是Mingw( - w64)遵循GCC版本(4.8.x,4.9.x等)。如果您不需要特定版本,则应使用最新版本。



    线程问题



    如果抛出的异常是:

     在抛出'std :: system_error'实例后终止
    what():启用多线程来使用std :: thread:不允许操作

    然后只是 link




    建议



    如果您没有理由使用特定的选项;我的个人推荐:

      posix  -  dwarf  -  2 




    • Posix 启用C ++ 11 < thread> < mutex> < future>

    • 矮人
    • 更快
    • 2 ,因为它是最新版本


    In the MinGW-W64 online installer there are several fields you can select. However I cannot find any documentation on this, and the guesses I've made don't give me the behaviour I want.

    Clearly a lot of work has gone into this project so it seems a pity that uptake is being held back by lack of basic documentation.

    The "Version" and "Architecture" fields are self-explanatory but the other fields I have trouble with are (values shown as of current installer):

    • Threads, options posix and win32
    • Exception, options dwarf and sjlj
    • Build revision, options 0, 1, 2.

    The values I chose on my previous install were win32, seh and 1 (clearly the options have changed since then but I am none the wiser as to what's what).

    What are the pros and cons of each option, especially the threading model and exception handling, and which version is "best"?

    The specific problems I have encountered using x86_64-win32-seh-rev1 are:

    • std::thread and std::condition_variable are not supported
    • When debugging (using Code::Blocks as IDE), if an exception is thrown it does not jump to the exception handler; selecting Next Line does nothing 3 times and then aborts the run.

    I can cope with the debugging problem but it would be really nice to have working C++11 threads.

    解决方案

    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

    这篇关于mingw-w64安装程序中选项的含义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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