VISUAL C ++ /工作室:应用程序配置不正确? [英] Visual C++/Studio: Application configuration incorrect?

查看:84
本文介绍了VISUAL C ++ /工作室:应用程序配置不正确?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的C(+ +)计划,编写和使用Visual C(++)/ Visual Studio中编译,运行良好我自己的机器,但拒绝到另一台机器上运行。该错误消息我得到的只是此应用程序未能启动,因为应用程序配置不正确。重新安装应用程序可能会解决这个问题。

My C(++) program, written and compiled using Visual C(++)/Visual Studio, runs fine on my own machine, but refuses to run on another machine. The error message I get is "This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem."

推荐答案

如果你写一个C ++程序,它动态链接到C运行时库,或CRT简称。这个库包含您的printf,你的malloc,你strtok的,等等。该库包含称为MSVCR80.DLL的文件中。此文件不是由安装在Windows系统上的默认,因此应用程序无法运行。

If you write a C++ program, it links dynamically to the C Runtime Library, or CRT for short. This library contains your printf, your malloc, your strtok, etcetera. The library is contained in the file called MSVCR80.DLL. This file is not by default installed on a Windows system, hence the application cannot run.

该如何解决?无论是通过安装在Vcredist.exe将目标机器上的DLL(Visual C ++的再发行组件包),或链接到CRT静态(堵塞的实际code为使用的功能直接进入你的EXE)。

The solution? Either install the DLL on the target machine through VCREDIST.EXE (the Visual C++ Redistributable Package), or link to the CRT statically (plug the actual code for the used functions straight into your EXE).

和分发用一个简单的应用程序一起安装VCREDIST是一个痛苦的屁股,所以我去了第二个选项:静态链接。它真的很容易:去你的项目的属性,展开C / C ++,单击code生成和运行时库设置的非DLL的选项之一。这一切就是这么简单。

Distributing and installing VCREDIST along with a simple application is a pain in the arse, so I went for the second option: static linking. It's really easy: go to your project's properties, unfold C/C++, click Code Generation, and set the Runtime Library to one of the non-DLL options. That's all there is to it.

这篇关于VISUAL C ++ /工作室:应用程序配置不正确?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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