C++可执行文件 - MSVCR100.dll 未找到错误
我已经下载并编译了一个开源 C++ 应用程序 Frhed。
当我运行我编译的版本时,它需要 MSVCR100 和一些其他 dll 文件(Visual C++ 可再发行组件的一部分)。但是,当我运行原始预编译的 Frhed 可执行文件时,它在没有安装任何 C++ 可再发行组件包的情况下运行。
我是否必须修改任何编译选项才能取消程序与 C++ 可再发行库的链接?
I've downloaded and compiled an open-source C++ application, Frhed.
When I run the version I've compiled, it demands MSVCR100 and few other dll files (part of Visual C++ redistributable). However, when I run the original precompiled Frhed executable, it runs without any C++ redistributable package installed.
Do I have to modify any compilation options in order to unlink the program from the C++ redistributable libraries?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
原始程序可能是静态链接,而您尝试动态链接可执行文件,这会产生较小的文件,但依赖于
MSVCR100.dll
(v10 Microsoft C 运行时库的一部分),如果静态链接,该文件将包含在可执行文件中。要静态链接 DLL,请进入项目属性并将构建模式从
MD
更改为MT
。在 Visual Studio 2010/2012 中,该项目属性是 C/C++ ->代码生成->运行时库。The original program is probably statically linked, whereas you are trying to dynamically link your executable, which results in a smaller file, but a dependency on functions inside
MSVCR100.dll
(v10 of the Microsoft C Runtime Library), which would have been included inside the executable if you were statically linking.To statically link DLLs, go into your project properties and change the build mode from
MD
toMT
. In Visual Studio 2010/2012, that project property is C/C++ -> Code Generation -> Runtime Library.简短的答案是是,较长的答案是,嗯,更长。
库
msvcr100.dll
是 C 运行时的 DLL 实现,您可能通过使用 /MD 编译选项来请求它。为了避免使用运行时的动态链接版本,您可以使用 /MT 选项并静态链接运行时。或者,您可以重新分发 msvcr100.dll(和其他文件)你的程序。
The short answer is yes, the longer answer is, well, longer.
The library
msvcr100.dll
is the 10.0 version (i.e., Visual Studio 2010 version) of the DLL implementation of the C run-time which you probably requested by using the /MD compile option. To avoid using the dynamically linked version of the run-time you can use the /MT option instead and statically link the run-time.Alternatively, you can redistribute msvcr100.dll (and other files) along with your program.