tags:

views:

133

answers:

5

I have an MFC application that runs on my computer, but when I try to run it on another PC I receive an error message that the application failed to initialize and I should re-install it. What should I do?

+6  A: 

See redistributing an MFC application from MSDN.

Generally you could install the Redistributing Visual C++ package for x86.

You can also compile your program to statically link the MFC dlls for easier deployment.

Brian R. Bondy
+1  A: 

You are missing some of the libraries, either link the application statically or install the VS redistributables on the other computer

See http://www.microsoft.com/downloads/details.aspx?FamilyID=9b2da534-3e03-4391-8a4d-074b9f2bc1bf

Martin Beckett
+2  A: 

The problem is that the other computer is missing the C/C++ runtime libraries. Install the version of the Microsoft Visual C++ runtime that matches the version of Visual C++ that you used to compile it on the other computer.

Alternatively, you can link the application statically. Right click on the project in the Solution Explorer and choose Properties, then naviagate to C/C++ > Code Generation > Runtime Libraries. Choose the Debug/Release option that doesn't include "DLL".

Nick Meyer
thank you for replaying ..I got an error message that says : Command line error D8016 : '/MTd' and '/clr:pure' command-line options are incompatible what can i do ?
MoazMohmmed
+2  A: 

You can link static or install the VC++ Redistributable Pack.

dwo
Thank you for replaying ..I used Nick's method "C/C++ > Code Generation > Runtime Libraries. Choose the Debug/Release option that doesn't include "DLL" , but I got an error message that says :Command line error D8016 : '/MTd' and '/clr:pure' command-line options are incompatible??
MoazMohmmed
A: 

If you get a message like "side-by-side configuration error", that means your exe must be shipped some extra files, probably MFC / ATL dlls. Use dependency walker to find out what are the dependencies : http://www.dependencywalker.com/