[英]MinGW / MinGW64 Linking and Dependency on `msvcrt.dll`
I am coding for WinAPI in MinGW 我在MinGW中为WinAPI编码
One thing I still have not fully understood is the VC redistributable, I got a whole pack of question to it 我仍然不完全了解的一件事是VC可再发行,我对此提出了一整套问题
Some say that such programs will need the msvcrt.dll
有人说这样的程序将需要
msvcrt.dll
I see something wrong is here as I would like to produce no dependency small exes only calling the system WinAPI and if I use some like C standard library functions functions I would prefer it economically and statically compiled in, not any third-party dependencies 我看到这里有问题,因为我不希望产生仅依赖于系统WinAPI的小依赖项,如果我使用C标准库函数之类的函数,我希望将其经济且静态地编译进去,而不希望任何第三方依赖项
Microsoft compilers can link with "static" libraries so that the resulting executable depends only on system DLLs like kernel32.dll, user32.dll, etc. MinGW cannot do this (yet). Microsoft编译器可以与“静态”库链接,因此生成的可执行文件仅取决于系统DLL,例如kernel32.dll,user32.dll等。MinGW无法做到这一点(至今)。
EDIT: A concise description of the MSVCRT.DLL problem is here . 编辑:MSVCRT.DLL问题的简要描述在这里 。
According to the MS White-paper here: 根据MS白皮书:
http://www.microsoft.com/en-gb/download/details.aspx?id=13350 http://www.microsoft.com/zh-CN/download/details.aspx?id=13350
you can redistribute certain parts of the Visual Studio components. 您可以重新分发Visual Studio组件的某些部分。
Some software, such as the Microsoft .NET Framework, can be distributed.
可以分发某些软件,例如Microsoft .NET Framework。 Components of software products included in MSDN subscriptions that can be distributed (either within an application or as separate files) without royalty are identified in the REDIST.TXT file associated with the product.
与产品相关联的REDIST.TXT文件中标识了MSDN订阅中包含的,可以分发(在应用程序中或作为单独的文件)而没有使用费的软件产品组件。 Components that can be distributed to non-Microsoft platforms are identified in the OTHER-DIST.TXT file associated with the product.
与该产品关联的OTHER-DIST.TXT文件中标识了可以分发到非Microsoft平台的组件。 Code identified as distributable that has the extension .lib cannot be directly distributed;
具有扩展名.lib的被标识为可分发的代码不能直接分发; it must be linked into the application.
它必须链接到应用程序。 However, the resulting output can be distributed.
但是,可以分配结果输出。
You may also:
您还可以:
- Modify and distribute source code and objects for code marked as “sample” or “Code Snippet”.
修改和分发标记为“样本”或“代码段”的代码的源代码和对象。
- Distribute the unmodified output of Microsoft Merge Modules for use with an application's .msi file.
分发Microsoft合并模块的未修改输出,以与应用程序的.msi文件一起使用。
- Distribute the MDAC_TYP.EXE file containing core data access components (such as the Microsoft SQL Server OLE DB provider and ODBC driver).
分发包含核心数据访问组件(例如Microsoft SQL Server OLE DB提供程序和ODBC驱动程序)的MDAC_TYP.EXE文件。
- Distribute the object version of C++ libraries (Microsoft Foundation Classes, Active Template Libraries, and C runtimes).
分发对象版本的C ++库(Microsoft基础类,活动模板库和C运行时)。
MS also produces a redistributable package specifically for the purpose of developers: http://www.microsoft.com/en-gb/download/details.aspx?id=40784 MS还专门为开发人员提供了可重新分发的程序包: http : //www.microsoft.com/en-gb/download/details.aspx?id=40784
So, to answer your questions: 因此,回答您的问题:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.