This application has failed to start because the application configuration is incorrect

Hi, I am just starting programming using Visual C++ 2005 Express Edition. I have had some limited practice in other languages and older versions of C++, so I have some idea whats going on but not much...

Anyway I made a short program which perfroms a bubble sort on an array of numbers which the user enters (I know its nothing to write home about but its a start), it works fine on my PC and when I sent it to a freind who also had VC++ 2005 Express Edition it worked fine for him.

However I then sent it to a freind without it (in a fairly poor attempt to persuade him to download it) , and my program didn't work on his PC giving the error: "This application has failed to start because the application configuration is incorrect". I was wondering if there was anything I could do to make it work on PC's without VC++ (and I think the .NET framework or something, that is with it), or if they have to have the above programs for it to work.

Thanks in advance for any help.
Ashley.


Answer this question

This application has failed to start because the application configuration is incorrect

  • Alan Zhong

    A first guess would be due to side by side (SxS) issues:

    Take a look at this link for more details on SxS and distributing applications:
    http://msdn2.microsoft.com/library/bxf4ee9f(en-us,vs.80).aspx

    In addition, Nikola's blog has lots of info on SxS:
    http://blogs.msdn.com/nikolad/archive/category/10324.aspx

    Here is a related post that deals with a similar issue:
    http://forums.microsoft.com/msdn/ShowPost.aspx PostID=62539

    Of course if you share out a code sample and a build log, I can probably dig out more details.

    Also, if your application is a managed one then you will need the .net framework on the machine running it.

    Thanks,
      Ayman Shoukry
      VC++ Team.

  • gr8Kiwi

    Thankyou for the advice, I will include the code below along with the build logs. I say logs as I was not sure whether I was supposed to build in debug mode or release mode so I did both, although they both work/don't work on the same computers. Also I didn't know whether my application is a managed one as I am not familiar with the concept.

    There is only one file in the project which is called sorter but is in a folder called hello, as a renamed it after I converted the code from a 'hello world' program. The file is sorter.cpp and is as below (although the original is indented though I doubt this makes a difference):

    // Simple Number Sorter with no Validation

    #include <iostream>

    #include <conio.h>

    using namespace std;

    int x, total,temp, flag;

    int arr1[100];

    void main()

    {

    cout << "RAOUL PRODUCTIONS C++ NUMBER SORTER" << endl;

    cout << "Enter the quantity of numbers you wish to enter(maximum 100): ";

    cin >> total;

    for (x=1; x<=total; x++)

    cin >> arr1[x];

    flag=1;

    cout << "Sorting..." << endl;

    while(flag&&1)

    {

    flag=0;

    for (x=1; x<total; x++)

    {

    if (arr1[x]>arr1[x+1])

    {

    temp=arr1[x+1];

    arr1[x+1]=arr1[x];

    arr1[x]=temp;

    flag=1;

    }

    }

    }

    cout << "Your numbers in order are: ";

    for (x=1; x<=total; x++)

    cout << arr1[x] << " ";

    cout << endl << "Press any key to exit...";

    while(!_kbhit());

    }

    The build log for the Debug version:
    Build started: Project: Sorter, Configuration: Debug|Win32

    Command lines:
    Creating temporary file "c:\Documents and Settings\Ashley\My Documents\Visual Studio 2005\Projects\hello\hello\Debug\RSP00002410283128.rsp" with contents
    [
    /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /Gm /EHsc /RTC1 /MDd /GS- /Fo"Debug\\" /Fd"Debug\vc80.pdb" /W3 /c /Wp64 /ZI /TP ".\sorter.cpp"
    ]
    Creating command line "cl.exe @"c:\Documents and Settings\Ashley\My Documents\Visual Studio 2005\Projects\hello\hello\Debug\RSP00002410283128.rsp" /nologo /errorReport:prompt"
    Creating temporary file "c:\Documents and Settings\Ashley\My Documents\Visual Studio 2005\Projects\hello\hello\Debug\RSP00002510283128.rsp" with contents
    [
    /OUT:"Debug\Sorter.exe" /INCREMENTAL /MANIFEST /MANIFESTFILE:"Debug\Sorter.exe.intermediate.manifest" /DEBUG /PDB:"c:\Documents and Settings\Ashley\My Documents\Visual Studio 2005\Projects\hello\hello\Debug\Sorter.pdb" /SUBSYSTEM:CONSOLE /MACHINE:X86  kernel32.lib

    ".\Debug\sorter.obj"

    ".\Debug\Sorter.exe.embed.manifest.res"
    ]
    Creating command line "link.exe @"c:\Documents and Settings\Ashley\My Documents\Visual Studio 2005\Projects\hello\hello\Debug\RSP00002510283128.rsp" /NOLOGO /ERRORREPORT:PROMPT"
    Creating temporary file "c:\Documents and Settings\Ashley\My Documents\Visual Studio 2005\Projects\hello\hello\Debug\RSP00002610283128.rsp" with contents
    [
    /out:".\Debug\Sorter.exe.embed.manifest" /notify_update /manifest

    ".\Debug\Sorter.exe.intermediate.manifest"
    ]
    Creating command line "mt.exe @"c:\Documents and Settings\Ashley\My Documents\Visual Studio 2005\Projects\hello\hello\Debug\RSP00002610283128.rsp" /nologo"
    Creating temporary file "c:\Documents and Settings\Ashley\My Documents\Visual Studio 2005\Projects\hello\hello\Debug\BAT00002710283128.bat" with contents
    [
    @echo Manifest resource last updated at %TIME% on %DATE% > ".\Debug\mt.dep"
    ]
    Creating command line """c:\Documents and Settings\Ashley\My Documents\Visual Studio 2005\Projects\hello\hello\Debug\BAT00002710283128.bat"""

    Output window:

    Compiling...
    sorter.cpp
    Linking...
    Embedding manifest...

    Results:

    Build log was saved at "file://c:\Documents and Settings\Ashley\My Documents\Visual Studio 2005\Projects\hello\hello\Debug\BuildLog.htm" Sorter - 0 error(s), 0 warning(s) 

    The build log for the Release version:
    Build started: Project: Sorter, Configuration: Release|Win32

    Command lines:
    Creating temporary file "c:\Documents and Settings\Ashley\My Documents\Visual Studio 2005\Projects\hello\hello\Release\RSP00002C10283236.rsp" with contents
    [
    /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /FD /EHsc /MD /Fo"Release\\" /Fd"Release\vc80.pdb" /W3 /c /Wp64 /Zi /TP ".\sorter.cpp"
    ]
    Creating command line "cl.exe @"c:\Documents and Settings\Ashley\My Documents\Visual Studio 2005\Projects\hello\hello\Release\RSP00002C10283236.rsp" /nologo /errorReport:prompt"
    Creating temporary file "c:\Documents and Settings\Ashley\My Documents\Visual Studio 2005\Projects\hello\hello\Release\RSP00002D10283236.rsp" with contents
    [
    /OUT:"Release\Sorter.exe" /INCREMENTAL:NO /MANIFEST /MANIFESTFILE:"Release\Sorter.exe.intermediate.manifest" /DEBUG /PDB:"c:\documents and settings\ashley\my documents\visual studio 2005\projects\hello\hello\release\Sorter.pdb" /SUBSYSTEM:CONSOLE /OPT:REF /OPT:ICF /MACHINE:X86  kernel32.lib

    ".\release\sorter.obj"
    ]
    Creating command line "link.exe @"c:\Documents and Settings\Ashley\My Documents\Visual Studio 2005\Projects\hello\hello\Release\RSP00002D10283236.rsp" /NOLOGO /ERRORREPORT:PROMPT"
    Creating temporary file "c:\Documents and Settings\Ashley\My Documents\Visual Studio 2005\Projects\hello\hello\Release\RSP00002E10283236.rsp" with contents
    [
    /outputresource:".\release\Sorter.exe;#1" /manifest

    ".\release\Sorter.exe.intermediate.manifest"
    ]
    Creating command line "mt.exe @"c:\Documents and Settings\Ashley\My Documents\Visual Studio 2005\Projects\hello\hello\Release\RSP00002E10283236.rsp" /nologo"
    Creating temporary file "c:\Documents and Settings\Ashley\My Documents\Visual Studio 2005\Projects\hello\hello\Release\BAT00002F10283236.bat" with contents
    [
    @echo Manifest resource last updated at %TIME% on %DATE% > ".\release\mt.dep"
    ]
    Creating command line """c:\Documents and Settings\Ashley\My Documents\Visual Studio 2005\Projects\hello\hello\Release\BAT00002F10283236.bat"""

    Output Window:
    Compiling...
    sorter.cpp
    Linking...
    Embedding manifest...

    Results:

    Build log was saved at "file://c:\Documents and Settings\Ashley\My Documents\Visual Studio 2005\Projects\hello\hello\Release\BuildLog.htm"
    Sorter - 0 error(s), 0 warning(s)

    Sorry about the excessive length (and poor formatting) of the post, I was not sure what you needed. Also it may be a stupid question but am I right to be sending just the exe file to other people or am I supposed to give them something with it


  • Andrew Watt

    I was also stuck by this problem. I developped an app with VS 2005 Pro on WinXP SP2 but could not ran it on WinXP SP1, though i was using both 2 MSDN's deployment methods (). Finally, installing Windows Installer 3.1 (Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\WindowsInstaller3_1) helped me solve this problem.

     


  • NandaRengasamy

    I've found that what I need to do is create a setup project, and then copy the MSI file to the machine I want to run my application on, and then install it.  If I do this it installs: msvcm80, msvcp80, msvcr80 and odbc32.dlls, and x86_Microsoft.VC80.CRT.manifest as well as my application.

    I cannot find this manifest in my developement directories, I guess it lives in the Windows folders. 

    Prior to this upgrade, I could just copy an exe, and run it.

    BTW, what C++ compiler and link settings do I need to build for an AMD 64 bit Athon   When I try it with Visual Studio it builds the objects, but won't link them.


  • Gokul Singh

    vbvan, I agree it is strange, however they did do this so that any application that happened to be written for older versions of the CRT (e.g. beta 2) would automatically redirect to the RTM versions of the CRT (8.0.50727,42)

    Richard Grimes has written an article that explains it somewhat (although, his conclusions about it being a quality control issue, are, I believe incorrect, i.e. I believe they purposely kept it at 8.0.50608.0 for the reasons I mentioned):

    The article is here (please try to ignore the anti-Microsoft comments as it is still a good article overall)

    http://www.grimes.demon.co.uk/workshops/fusWSThirteen.htm


  • jimmy_iitd

    Below described steps are a workaround that only applies to VS2005 Beta2. This does not work with the final release of VS2005

    Hi,

    You need to copy CRT DLL into your application local folder together with the manifest. Please take a look on this post on my blog, http://blogs.msdn.com/nikolad/archive/2005/03/18/398720.aspx. Basically go to windows\winsxs folder. Find a folder like x86_Microsoft.VC80.CRT and copy DLL from there to your application local folder. From what I see in your code you need msvcrt80.dll and msvcp80.dll (perhaps msvcrt80d.dll and msvcp80d.dll if this is Debug mode application). Then go to windows\winsxs\manifests folder and copy x86_*_Microsoft.VC80.CRT*.manifest to Microsoft.VC80.CRT.manifest to your application local folder. Take a look on my blog, it has detailed instructions.

    Thanks,
    Nikola



  • Myrco

    A more useful response would be to link statically instead of with the DLL versions of the run-time libs.

  • Keith5150

    You can only link dynamically to OpenMP.

    Nikola



  • Yoshihiro Kawabata

     Schpidah wrote:
     troff wrote:
    A more useful response would be to link statically instead of with the DLL versions of the run-time libs.


    I am trying to do exactly this, but I'm still getting the (worthless) error message.  I have an MFC-based application, which also uses (as Linker Input) winmm.lib and opengl32.lib.  It also uses "#pragma comment" to include the following:
    ...


    Update.  I feel a little silly... it appears that my problem is due to use of OpenMP.  So, now I just need to figure out how to statically link OpenMP.

  • squishy

     troff wrote:
    A more useful response would be to link statically instead of with the DLL versions of the run-time libs.


    I am trying to do exactly this, but I'm still getting the (worthless) error message.  I have an MFC-based application, which also uses (as Linker Input) winmm.lib and opengl32.lib.  It also uses "#pragma comment" to include the following:

    dsound.lib
    dxguid.lib.

    This application also includes four of my own libraries.

    All four of my libraries, and the main app are built with Unicode, /MT, static MFC.

    All I want is a standalone executable... what am I doing wrong   I even started over with a dialog-based static MFC application generated by the Application Wizard... this program worked fine (but did nothing) on whatever machine I copied it to... until I added my code and linked in the above MS libs and my own libs.

        -Brad

  • Supriya

    Something I noticed: Nikola's steps for installing applocal from August 15th no longer works for RTM.  For that purpose, the CRT manifest in c:\windows\winsxs\manifests has the wrong version number.  After copying it to your applocal subfolder (Microsoft.VC80.CRT) and renaming to Microsoft.VC80.CRT.manifest, instead of 8.0.50727.42 you need to put in 8.0.50608.0.  Leaving it at 8.0.50727.42 will cause the same application configuration error.

    This is especially important for VC Express users, as the \program files\microsoft visual studio 8\VC\redist\x86\Microsoft.VC80.CRT folder (which does all of the above for you) does not exist.

  • Lavanya.R

     Gerry Rempel wrote:
    This error message is uselessly vague.  Is there a way to get the Visual Studio 2005 linker to tell you which DLLs you need to destribute   and which manifest file   It should copy these into the binary directory with the application and tell you about it.  With 2005 it has just gotten harder to build a program and copy it to another machine.  Why should it

    Do I need to create a setup project


    Actually I disagree with a statement that it became harder to understand what DLLs has to be redistributed. In VS2005 the manifest clearly describes dependencies of an application and as long as they are installed on another computer, the application works fine. Linker is not meant to do any magic and prepare an app for redistribution. The only reason for the linker to exist is to link final binary from object files and what it successfully does.

    Overall deployment of VC++ applications is described in http://msdn2.microsoft.com/en-us/library/zebw5zk9(en-US,VS.80).aspx. You may follow steps described in http://msdn2.microsoft.com/en-us/library/ms235265(en-US,VS.80).aspx in understanding all dependencies of an application. Steps for creating a setup project are described in http://msdn2.microsoft.com/en-us/library/ms235285(en-US,VS.80).aspx

    Nikola
    VC++

  • David Griffin

    This error message is uselessly vague.  Is there a way to get the Visual Studio 2005 linker to tell you which DLLs you need to destribute   and which manifest file   It should copy these into the binary directory with the application and tell you about it.  With 2005 it has just gotten harder to build a program and copy it to another machine.  Why should it

    Do I need to create a setup project

  • Webbee

    Hi, Ted. It seems strange that although the ver number in manifest becomes 8.0.50608.0 in RTM, but the ver of the corresponding dll is still 8.0.50727.42 (both in VC\redist\x86 & Windows\WinSXS).
  • This application has failed to start because the application configuration is incorrect