如何在VS2013静态链接到MSVCP120.dll [英] How to statically link to MSVCP120.dll in VS2013

查看:271
本文介绍了如何在VS2013静态链接到MSVCP120.dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我启动.exe它错误MSVCP120.dll丢失。如何添加静态链接到项目。是链接器吗?我需要给MSVCP120.dll的路径吗?

解决方案

一般来说,不要使用静态CRT连接,因为它创建一个潜在问题的数量,安全风险和维修问题。您可以要求运行VC ++ REDIST软件包(需要管理员权限)才能安装系统版本,您可以使用自己的MSI安装程序使用VC ++ MSM模块,也可以使用并行部署和放置与EXE相同的文件夹中的DLL。



请参阅重新分发Visual C ++文件



您可以使用Win32桌面应用程序的静态链接,但只有少数几个地方使用是有必要的(即安装前的实用程序)。作为编译的一部分,CRT设置与其他Visual Studio版本相同,作为命令线程切换或IDE中的项目属性/ C / C ++ /代码生成中的设置为多线程(/ MT)或多线程调试(/ MTd)

您不能对Windows Store应用程序,Windows Phone 8.x或Xbox One应用程序使用静态链接。


When I launch .exe it gives error MSVCP120.dll is missing. How do I add statically link to project. Is it in Linker? Do I need to give path to MSVCP120.dll?

解决方案

In general, you should not use static CRT linking as it creates a number of potential problems, security risks, and servicing concerns. You can require the VC++ REDIST package to be run (which requires admin rights) to install the 'system' version, you can use the VC++ MSM modules with your own MSI installer, or you can just use side-by-side deployment and put the DLLs in the same folder as your EXE.

See Redistributing Visual C++ Files

You can use static linking for Win32 desktop apps, but there's only a few places where such use is warranted (namely pre-installation utilities). The CRT settings are the same as other Visual Studio editions as part of the compilation as a command-line switch or a setting in the IDE under Project Properties / C/C++ / Code Generation to either "Multi-threaded (/MT)" or "Multi-threaded debug (/MTd)"

You cannot use static linking for Windows Store apps, Windows phone 8.x, or Xbox One apps.

这篇关于如何在VS2013静态链接到MSVCP120.dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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