Click here to Skip to main content
15,880,405 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I have some limited practice in VC++ 2008. I wrote a short program to sort a list of numbers. It works fine on my PC and when I sent it to a freind who also had VC++ 2008 it worked fine for him. However when I sent it to a freind without VC++ 2008,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++. Thanks in advance for any help.

Regards,
Aravind K R
Posted
Updated 16-Feb-11 22:08pm
v2
Comments
ShilpiP 17-Feb-11 4:20am    
1) I think you send him a debug exe not release one.
2) If your application is MFC based than choose option "use mfc in a static library".
Try this, I hope it works.
aravindkrgec 17-Feb-11 4:28am    
Thank you for the response. But I think I did sent the debug exe.
ShilpiP 17-Feb-11 4:35am    
okk just send him a release exe. It will working fine ans second most important thing if you are using MFC than select USE MFC IN A STATIC LIBRARY, else he get the side by side configuration is incorrect. :)
aravindkrgec 17-Feb-11 4:48am    
Thank you very much. It worked quite perfectly.
ShilpiP 17-Feb-11 4:59am    
Most welcome... :)

Hi,

this is most probably happening because the PC that does not work doesn't have the correct VC++ redistributable installed. For VS2008 you can download it here:
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=9b2da534-3e03-4391-8a4d-074b9f2bc1bf&displaylang=en[^]
and for VS2008 SP1 here:
http://www.microsoft.com/downloads/en/details.aspx?familyid=A5C84275-3B97-4AB7-A40D-3802B2AF5FC2&displaylang=en[^]
 
Share this answer
 
Comments
Olivier Levrey 17-Feb-11 7:03am    
Voted 5. It happened to me so many times...
Espen Harlinn 20-Feb-11 9:29am    
Agree, another 5 :)
An alternative would be to use a static link to the CRT and MFC runtimes. This will increase the size of your .exe and in rare cases when mixing MFC DLLs and MFC EXEs will not work, however it means that the runtimes mentioned by JF2015 are not required to run.

This can be done by going to the
Project Properties>General>Use of MFC=Use MFC in a Static Library
and
Project Properties>C/C++>Code Generation>Runtime Library=Multi-threaded (or Multi-threaded Debug for a debug configuration)
 
Share this answer
 
The first thing to check is if your executable is built in debug mode, i.e. using debug version dll's. I don't think the debug dll's are redistributable (I might be wrong). Your release built executable is depending on three different dll's I would guess: mfc90.dll, msvcp90.dll and msvcr90.dll. These are probably the ones missing on the failing target machine. You will have to distribute them along with your executable.

Edit: splelign
 
Share this answer
 
v2
Comments
Cedric Moonen 17-Feb-11 4:58am    
You can't distribute the dll's anymor, you have to install the C++ redistributable package on the target machine.
Niklas L 17-Feb-11 5:50am    
Oh, didn't know that. Thanks!
Nemanja Trifunovic 17-Feb-11 10:45am    
You can distribute the dll's even without the redistributable package - the difference is, depending on the version of VC++ (or even Windows?) you need to supply a manifest file together with the dlls.
Albert Holguin 17-Feb-11 23:07pm    
Nemanja is correct.... just include the manifest along

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900