Visual Studio 2010 运行时库 [英] Visual Studio 2010 Runtime Libraries

查看:37
本文介绍了Visual Studio 2010 运行时库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了一个许多用户会在他们的计算机上使用的工具.但是,我注意到,未安装 Visual Studio 的用户无法打开我的可执行文件.该错误表示缺少 msvcp100.dll.我在互联网上发现了一个来自微软的可再发行包,它显然应该提供这些 dll.我的问题是:有没有另一种方法可以绕过这个问题?类似于项目属性中的选项?

I wrote a tool that many users would use on their computers. I noticed however, that users who do not have visual studio installed, cannot open my executable. The error says that msvcp100.dll is missing. I found in internet a redistributable package from microsoft, that should apparently provide these dlls. My question is: is there another way to bypass this problem? Something like an option in the project properties?

推荐答案

是的,您可以更改编译器设置以将 C++ 标准库类链接到您的程序中,而不是依赖于 DLL.在解决方案资源管理器窗口中右键单击您的项目,属性.切换到发布配置(左上角).C/C++、代码生成、运行时库设置.选择/MT.

Yes, you can change a compiler setting to link the C++ standard library classes into your program instead of having a dependency on the DLL. Right-click your project in the Solution Explorer window, Properties. Switch to the Release configuration (upper left). C/C++, Code Generation, Runtime Library setting. Select /MT.

仅当您只有一个单一的 EXE 时才执行此操作.当您使用自己的 DLL 时,您确实需要 msvcr100.dll 和 msvcp100.dll,以便在所有模块之间共享运行时库.

Only do this when you only have a single monolithic EXE. When you use your own DLLs then you really need msvcr100.dll and msvcp100.dll so that the runtime library gets shared between all modules.

这篇关于Visual Studio 2010 运行时库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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