views:

41

answers:

2

I have a c++ code developed with Visual C++ 2008, which creates a .exe file in the dubug subfolder of the application. The program runs properly on the development machine, a Windows Vista PC, but does not run when installed on another machine, a Windows XP PC on which Visual c++ 2008 is not installed. (I used InstalShield 2010 to deploy the program). Even when I recompiled the program with CODEBLOCKS, it still doesn't run on the other machine, whereas it runs perfectly well on the development PC. Any ideas how to resolve this problem? Or is there any easier way to deploy C++ programs to run on any PC?

+2  A: 

It requires CRT runtime. Standard runtime supports only release version, so deploy the release version of the exe.

ruslik
Yep.. debug will only run on systems with VS on them.
baash05
A: 

The easiest way is to statically link everything. Go to your projects properties/settings and set the static link options (MFC etc). Now you can distribute just the .exe if you perfer.

Otherwise, create a new setup/deployment project. It should detect all your dependencies automatically (but you should check), and create an .msi file for your users to install your program with all dependencies together.

Also, if you're .exe is in your Debug folder, you are probably only building the debug version. You might want to build and distribute the Release version instead.

Inverse
Thanks guys. I've tried the release version and the static link options. The code now runs perfectly on other machines.
T J