Sign in to follow this  
Ehrys

Application Configuration Is Incorrect

Recommended Posts

So I wrote a basic "Hello World" console application so that my gf could see how programming worked. Problem: On EVERY machine apart from my own, the application fails to run with the message "This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem."
#include <iostream>

int main(int argc, char** argv)
{
    std::cout << "Hello World" << std::endl;
    return 0;
}

Also, anything I build will no longer work on any machine other than my own. Which is very problematic considering that means NONE of my submitted coursework is going to work on the examiners machine. Yet runs perfectly well on my own. Speaking of this example in question, I checked the build configs for libraries that might have sneaked in and there are none there. I should point out that I'm using Visual Studio 2005 SP1 as my IDE and my OS is XP SP2.

Share this post


Link to post
Share on other sites
Couple of things that could be going on here. For one, VS 2005 should be generating a manifest file along with your application - this file needs to accompany your exe as you move it from one machine to another (see this link for more info). Second, the machine you're trying to run your executable on may not have the proper runtime libraries installed which are required for VC++ applications. You have to run a program called VCRedist.exe (see this article for further info; downloads: x64, x86). One of those options should solve your problem.

Share this post


Link to post
Share on other sites
It is possible to avoid running vcredist.exe or messing with Merge Modules.
Simply copy the files in $visualstudio\VC\redist\x86\Microsoft.VC80.CRT to your application's directory, that ought to do it.
If the error persists, the Windows event viewer has minimally helpful information on exactly which manifest/SxS is causing the problem.

Share this post


Link to post
Share on other sites
If I used, per say, Dev-C++ instead with the mingw compiler, I wouldn't need the vcredist would I?

Share this post


Link to post
Share on other sites
Quote:
Original post by Ehrys
If I used, per say, Dev-C++ instead with the mingw compiler, I wouldn't need the vcredist would I?

To my knowledge, no, you wouldn't need VCRedist if you used Dev-C++ instead.

Share this post


Link to post
Share on other sites
I second the suggestion to just copy the "Microsoft.VC80.CRT" folder. Then just archive the whole directory, and send that over.

If that's not the best idea, go into your project settings and link statically to the MS CRT library. Your EXE size goes up, but then you don't have to include the msvcr* DLL files separately.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this