Application Configuration Is Incorrect

Started by
4 comments, last by psykr 16 years, 11 months ago
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.
Advertisement
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.
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.
E8 17 00 42 CE DC D2 DC E4 EA C4 40 CA DA C2 D8 CC 40 CA D0 E8 40E0 CA CA 96 5B B0 16 50 D7 D4 02 B2 02 86 E2 CD 21 58 48 79 F2 C3
If I used, per say, Dev-C++ instead with the mingw compiler, I wouldn't need the vcredist would I?
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.
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.

This topic is closed to new replies.

Advertisement