MS VC ++如何构建DLL而不需要vc redist

时间:2022-09-01 19:47:33

I'm trying to build a simple .Net wrapper around some basic C++ code.

我正在尝试围绕一些基本的C ++代码构建一个简单的.Net包装器。

The C++ code does not rely on anything in the vcredist dlls, so I'm wondering if I can setup my project, so it doesn't require those dlls to work ?

C ++代码不依赖于vcredist dll中的任何东西,所以我想知道我是否可以设置我的项目,所以它不需要那些dll工作?

I'd hate to have my users download and run vcredist, just for a simple DLL to work.

我不想让我的用户下载并运行vcredist,只是为了一个简单的DLL工作。

1 个解决方案

#1


You need to link your DLL with the "Use the CRT as a static library" option:

您需要将DLL与“将CRT用作静态库”选项链接:

Project properties / Configuration / C/C++ / Code Generation / Runtime library / Multithreaded (ie. not any of the "DLL" options).

项目属性/配置/ C / C ++ /代码生成/运行时库/多线程(即不是任何“DLL”选项)。

#1


You need to link your DLL with the "Use the CRT as a static library" option:

您需要将DLL与“将CRT用作静态库”选项链接:

Project properties / Configuration / C/C++ / Code Generation / Runtime library / Multithreaded (ie. not any of the "DLL" options).

项目属性/配置/ C / C ++ /代码生成/运行时库/多线程(即不是任何“DLL”选项)。