locked
VC ++ error - Application failed to initialize properly. RRS feed

  • Question

  • Hi,

    I am a newbie to VC++ and I changed a little bit of an existing program and tried to distribute the file so others could use the revised edition. I get this error:

    1. The application failed to initialize properly (0xc0150002). CLick on OK to terminate the application.

    I assumed that the exe lacks certain dll's and hence installed the x86 redistribution package on the client computer (which does not have VC++ installed) but still the problem persists.

    I used dependables.exe to see the list of dll's required, even though the client computer has the necessary dll's in the sys folder, the application fails to see it.

    When I use this exe on any other computer which 'has VC++ installed', the program works fine. Just on computers not havign VC++ there is this problem. I think the dll's are not in the specified location. How do I fidn out what location the dll's should be in for the exe to work? I have even placed the dll's (such as MSVCP80d, MFC80,MSVCR80D, MSVCR80 etc) in the local directory but to no avail. Any help will be greatly appreciated. Thank you for your time.

    Regards

    Viveque.

     

     

    Friday, October 6, 2006 12:21 AM

Answers

  • First, the VC runtime package has the release builds only. If you built if for debug then you should rebuild it for release and then try it. There is a pretty big difference between the two. If that doesn't work, try to link it with the static runtime rather than the dll, that way there shouldn't be the dependency problem.
    Friday, October 6, 2006 12:34 AM

All replies

  • First, the VC runtime package has the release builds only. If you built if for debug then you should rebuild it for release and then try it. There is a pretty big difference between the two. If that doesn't work, try to link it with the static runtime rather than the dll, that way there shouldn't be the dependency problem.
    Friday, October 6, 2006 12:34 AM
  • Hi,

    Thanks for the message. I tried to statically link rather than dll and it still gives me the same error. I am now not sure if it is a DLL issue itself bcos of this. I assumed it was a dll issue, but I am completely lost? Any help or suggestions.

    Thanks

    VR

    Friday, October 6, 2006 8:50 PM
  • Hmm, if you changed the compiler option from /MD to /MT (or /MDd to /MTd if you are using debug) then there should be no problems. Have you tried it with a small test app to see if it does the same thing?

    There are several other possibilities though, did you also write a DLL file yourself to go with that project? If you did, did you also change that to static linking.

    Do you depend on a third party DLL? If you do, have you got it in a place where your program can find it, and does it work on your system normally.

    Is your project a managed project? If it is managed, do you have the .net framework installed on the target computer.

    This error is caused because your program, or one of its dependencies, failed to start. That means it can be any file that the main exe uses which is the cause of this.

    Sunday, October 8, 2006 11:18 PM
  • Hi,

    Thanks for the suggestions. I tried each one of the above but to no avail. A simple test I did was this:

    1. I installed MS Visual Studio 2005 on my laptop. I now moved the executables with their dll's to my laptop and lo behold, the program works fine.

    2. I then un-installed MS Visual Studio 2005 on my laptop and now tried the program and it crashes with the error message - "The application failed to initialize properly (0xc0150002). Click on OK to terminate the application."

    3. I then installed the MS Visual Studio 2005 C++ redistributable package (vcredist_x86.exe) which installs the necessary components to port my VC++ program over. But the error continues with the same message.

    Any help/suggestions will be greatly appreciated.

    VR.

    Wednesday, October 11, 2006 9:51 PM
  • Hi All,

     

    I am also facing similar kind of problem.

     

    I have a system with Visual studio 2005 installed in it.

     

    I have created an application which uses a dll. I have selected statically link MFC dll.

     

    But if i try to execute this application in other system, in which Visual studio is not installed, the below error is displayed.

     

    "Application failed to initialize properly (0xc0150002)"

     

    Waiting for reply. Thanks in advance

     

    Sharath Kottadamane

    Tuesday, May 22, 2007 10:23 AM
  • I am facing with same thing. I am using VC2005. I am not using mfc at all and all my used dlls and executable are compiled with /MT switch.

    What should I do now ?
    Any help will be appriciated .
    Monday, June 9, 2008 2:12 PM
  • Hi All,

     

    I am having a similar problem. I have VS2005. I ran the VS2005 C++ runtime installation (redistributable). Now when I try to debug a solution/project, I am getting this error

     

    "The application failed to initialize properly (0xc0150002). Click on OK to terminate the application."

     

    If anyone finds a solution, then pls let everyone else know.

     

    Thanks !

    Wednesday, July 23, 2008 2:18 PM
  • same thing but in other situation. I compiled my project under vs2008.
    It works fine on my laptop. but when I run it on another computer it faces with the intended error. The second computer has VS2005 but the problem persists.

    What should I do?

    Friday, August 22, 2008 10:54 AM
  • http://www.dependencywalker.com/

    Download this free app and open your executable with it.  It'll tell what your DLLs your app is requesting.  It's then very easy to work backwards from there once you know what it's requesting and makes it less of an guessing game.

    Good luck.
    Sunday, August 24, 2008 9:31 PM
  • Try to check the package Visual C++ Redistribution installed on the machines.
    The different versions might cause this issue.
    - vcredist.exe for VS2005
    - vcredist.exe for VS2005 SP1
    - vcredist.exe for VS2008

    Wednesday, September 24, 2008 3:09 AM
  • I have the same problem. I use MSVS 2008 professional, write a release program and an installer. I run the intaller on another machine and get this error when I try to run. I can't get through to MS support.

    This is a fundamental problem and it is unresolved after two years. How can MS stay in the compiler business if developers cannot distribute their creations? Anyone have work-arounds for Microsoft? Are there better compilers? Do we need to go Linux?
    • Proposed as answer by Anviksingh Tuesday, February 2, 2010 11:50 AM
    Tuesday, July 28, 2009 6:35 PM
  • Hi All,

    This problem basically comes due to run time libraries.
    Visual studio has different versions of binaries (dlls) in their releases, which it tries to find on the deployed machine.
    The best solution for this is: Make a setup solution as a sub project in main project which takes all the outputs of the project and put it into a single deployment project.
    Making such a deployment project in simple steps.
    1)Right click on solution in VS.
    2)Add a new project.
    3)Choose Other Project Types -> Setup and Deployment
    4)Right click on setup project -> add -> project output
    5)Select the outputs of each sub projects added in the solution.
    6)Check the dependencies of each added project output by right click on "project output group" now visible in setup solution. [Critical: here check all the dependency + if needed add some additional files which are displayed in dependency, may be something like xxx_vsxx_msmxx...]
    6)Build the setup project.

    After this install the setup and try to run.

    May this helps you :)
    • Proposed as answer by Anviksingh Tuesday, February 2, 2010 11:52 AM
    Tuesday, February 2, 2010 10:24 AM
  • Correcting SideBySide issues in VS 8 (2005):

    I recently struggled with this for about a week and couldn’t find the solution anywhere after scouring the web! Anyway, I finally managed to solve it by simply downloading the correct Visual   Studio service pack. This all came about by me attempting to use the Xtreme Tookit eval (ToolkitProEval.MFC.v13.3.1.exe). This required the service pack ending in version 8.0.50727.4053. There were three different version numbers in my experience 8.0.50727.42, 8.0.50727.762 and 8.0.50727.4053. The last being the latest released 7/28/2009…

    Everything would compile just fine, but I got the old “The application failed to initialize properly (0xc0150002). Click on OK to terminate the application.” Dialog and “LDR: LdrpWalkImportDescriptor() failed to probe…” message in my output window when attempting to run from the debugger. You can see the version of VS used in any .dll file by opening it in Visual Studio 2005 and looking at the RT_MANIFEST. It comes up in HEX, but the version number can be seen in the ASCII version to the right. The version of the .dll must match the version of your .exe. The version of the .exe can be found in a similar manner.

    Anyway, just make sure all versions match up and you should be good to go!

    The latest VS80sp1 (8.0.50727.4053) can be found here:

    http://www.microsoft.com/downloads/details.aspx?familyid=7c8729dc-06a2-4538-a90d-ff9464dc0197&displaylang=en

     

    The one prior (8.0.50727.762) can be found here:

    http://www.microsoft.com/downloads/details.aspx?familyid=bb4a75ab-e2d4-4c96-b39d-37baf6b5b1dc&displaylang=en

     

    Tuesday, June 8, 2010 5:02 PM
  • Please try to copy all redist to distributed machine, For your own DLL please build it with release option. I have tried this, and it works now.

    C:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86

    Friday, July 16, 2010 9:57 AM
  • The real problem is that the Application manifest is referencing VC runtimes that don't exist on the target machine.  If you load your .EXE or .DLL into Visual Studio's resource editor you can hand edit the version string for the name="Microsoft.VC90.CRT".  Alternately, you ought to be able to use the manifest tool to extract the manifest as an XML file, then patch the XML and use the manifest tool to reapply to the .EXE or .DLL.
    Monday, November 15, 2010 7:38 PM