Mingw-w64,libgcc_s_seh.dll 的目的是什么? [英] Mingw-w64, what's the purpose of libgcc_s_seh.dll?

查看:171
本文介绍了Mingw-w64,libgcc_s_seh.dll 的目的是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 Mingw-w64 构建的库需要那些 dll:

Libraries built with Mingw-w64 require those dll:

libwinpthread-1.dll
libstdc++-6.dll
libgcc_s_seh-1.dll

我想知道这是怎么回事,每个 dll 的作用是什么?尤其是libgcc_s_seh,那是结构化的异常处理吗?我以为 mingw 不能和 seh 一起工作.

I wonder what's up with that, what each dll does? Especially libgcc_s_seh, is that structured exception handling? I thought mingw couldn't work with seh.

为什么 mingw 要求总是把那些 dll 和你的 exe 一起带上?

Why mingw requires to always bring those dll with your exe?

我想知道我是否只是在浪费时间,而不仅仅是将 Visual Studio 用作 Windows 编译器.不过它太臃肿了,安装需要 9 GB.

I wonder if I'm just wasting my time by not just using visual studio as a windows compiler. It's so bloated though, 9 gb for installation.

推荐答案

特别是libgcc_s_seh,那是结构化的异常处理吗?我以为 mingw 不能和 seh 一起工作.

Especially libgcc_s_seh, is that structured exception handling? I thought mingw couldn't work with seh.

较新版本的 GCC(4.8+,如果我正确的话)应该支持 MinGW 上的 SEH.

Newer versions of GCC (4.8+ if I'm correct) should support SEH on MinGW.

我想知道这是怎么回事,每个 dll 的作用是什么?

I wonder what's up with that, what each dll does?

他们提供运行时和标准库.

They provide the runtime and standard library.

  • libwinpthread:Windows 上的 PThreads 实现(线程)
  • libstdc++:C++ 标准库(C/C++ 库函数等)
  • libgcc_s_seh:异常处理 (SEH)
  • libwinpthread: PThreads implementation on Windows (Threading)
  • libstdc++: C++ Standard Library (C/C++ library functions etc.)
  • libgcc_s_seh: Exception handling (SEH)

为什么 mingw 要求总是把那些 dll 和你的 exe 一起带上?

Why mingw requires to always bring those dll with your exe?

因为您的程序使用它们.如果您编写的程序没有线程、标准库和异常以及任何操作系统交互,您将不需要它们.

Because your program uses them. If you write a program without threads, standard library and exception and any OS interaction you wont need them.

这些 DLL 提供了运行程序所需的一切.顺便提一句.这不是只属于 MinGW 的事情,在其他系统/编译器上也会发生.通常你只是没有注意到这一点,因为操作系统已经提供了库,例如.MSVC 库很可能在 Windows 机器上.动态链接总是需要某种库文件,在 Windows 上是 .dll,在 Linux 上是 .so.

These DLL's bring everything you need to run your program. Btw. this is not a MinGW only thing, and happens on other systems / compilers too. Often you just don't note this because the OS already ships the libraries, eg. MSVC libraries are very likely on a Windows machine. Dynamic linking always requires some sort of library files, that are .dll on Windows and .so on Linux.

如果您的系统上有它,请使用 ldd <您的应用程序> 来查看哪些库是动态链接的.

If you have it available on your system use ldd <your application> to see what libraries are dynamically linked.

您可以将这些 MinGW 库安装到系统库中或操作系统可以找到的地方.这使您的程序能够使用它,并且您不再需要随每个应用程序一起提供它(避免重复).

You can install these MinGW libraries into the system libraries or somewhere where the OS can find it. This enables your programs to use it and you no longer have to ship it with every application (what avoids duplication).

另一方面,另一个选择是静态链接它们.与动态链接不同,您不需要任何DLL;不利的一面是增加了应用程序的大小(因为现在这三个库现在都已集成到 exe 中).

On the other side another option is to static link them. Unlike dynamic linking, you don't need any DLL; on the downside is a increase of you applications size (as now the three libraries are baked into the exe now).

我想知道我不只是将 Visual Studio 用作 Windows 编译器,是不是在浪费时间.

I wonder if I'm just wasting my time by not just using visual studio as a windows compiler.

这取决于您的情况.但我的回答可能会让你更深入地了解.

This depends on your situation. But probably my answer will give you some more insight.

这篇关于Mingw-w64,libgcc_s_seh.dll 的目的是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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