简体   繁体   English

程序包C控制台应用程序(Visual Studio '13)

[英]Package C console application (Visual Studio '13)

I wrote a basic program for my mom, and now I want her to be able to use it. 我为妈妈写了一个基本程序,现在我希望她能够使用它。 Obviously, it works on my computer. 显然,它可以在我的计算机上使用。 Getting the .exe file from the project folder, and putting it on her computer doesn't work: it says MSVCR120d.dll is missing whenever the .exe is run. 从项目文件夹中获取.exe文件并将其放在她的计算机上是行不通的:它说,每当.exe运行时, MSVCR120d.dll is missing Makes sense--as her computer doesn't have Visual Studio on it. 很有道理-因为她的计算机上没有Visual Studio。 However, I tried installing the Visual C++ Redistributable Packages for Visual Studio 2013 , and that didn't work either. 但是,我尝试安装适用于Visual Studio 2013Visual C ++可再发行组件包 ,但该方法也不起作用。

To be honest, I'm not looking to spending hours of time to piece this all together. 老实说,我不是希望花费数小时的时间来将它们拼凑在一起。 This is something I will more than likely never do again--I've already done some searching and can only find subjects speaking of C++ distributions. 这是我很可能不会再做的事情-我已经进行了一些搜索,并且只能找到涉及C ++发行版的主题。 I want a way to get the console app on her computer to work. 我想要一种使她的计算机上的控制台应用程序正常工作的方法。

The more easy way is link statically . 更简单的方法是静态链接 That mean embed all the needed code to the app to run, in the final binary (.exe), eliminating dependency of other libraries. 这意味着将所有需要的代码嵌入到应用程序中,以最终的二进制文件(.exe)运行,从而消除了对其他库的依赖。

  • Go to Project Properties 转到项目属性
  • Go to Configuration Properties 转到配置属性
  • Go to C/C++ 转到C / C ++
  • Go to Code Generation 转到代码生成
  • Change Runtime Library (in Debug to Multi-Threaded Debug /MTd and in Release to Multi-Threaded /MT ) 更改运行时库 (在Debug中为Multi-threaded Debug / MTd ,在Release中为Multi- threaded / MT

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Visual Studio中创建C(不是C ++)控制台应用程序 - How to create C (not C++) console application in Visual Studio 防止控制台窗口在 Visual Studio C/C++ 控制台应用程序上关闭 - Preventing console window from closing on Visual Studio C/C++ Console application Visual Studio 2015“窃取”应用程序的控制台 - Visual Studio 2015 “stealing” the application's console 使用Visual Studio 2010,如何为Visual C ++ Win32控制台应用程序提供输入? - Using Visual Studio 2010, how do I provide input to a Visual C++ Win32 Console Application? 控制台嵌入式Visual C ++应用程序上的参数 - Arguments On a Console eMbedded Visual C++ Application Visual C ++ / Studio:应用程序配置不正确? - Visual C++/Studio: Application configuration incorrect? 如何使用 Visual Studio 将 Unicode 打印到 C 中的输出控制台? - How do I print Unicode to the output console in C with Visual Studio? WinCE应用程序的Hello World(C和C ++)-Visual Studio 2008 - Hello World (C and C++) for WinCE application - Visual Studio 2008 任何Windows版本上的Visual Studio 2013:C应用程序 - Visual Studio 2013: C Application on any Windows version Visual Studio Code:未传递给 C 命令行应用程序的参数 - Visual Studio Code: arguments not passed to C command line application
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM