views:

431

answers:

2

Hi,

I've build an app in VS2008 and built an exe file.

when I copy the exe file to another computer it doesn't work.

I get the message: This application has failed to start because the application configuration is incorrect.

can someone please write the simple steps needed for this to be solved?

thanks.

+2  A: 

You need to install the VS2008 runtime redistributable.

VS2008

VS2008 SP1

The version of the runtime needs to match the version of VS that compiled the program.

Stu Mackellar
Did it. But is still doesn't work...
Oded
In that case you have further dependencies that need to be copied too. What other libraries are you linking against?
Stu Mackellar
You can use Dependency Walker to verify what dependencies are missing - http://www.dependencywalker.com/
Stu Mackellar
for the sake of the example, the app only prints "hello", so what other libraries are linked?
Oded
It depends on the project settings. A default console project will only have dependencies on the runtime, in which case installing the correct runtime version - as linked - above is all that's required. Are you sure you've installed the correct runtime version? Are you using VS2008 RTM or VS2008 SP1?
Stu Mackellar
I solved the problem, I compiled and built the project in Release mode. Now it works.thank you all for the answers.
Oded
Ok - this is because the debug and release versions of the runtime are different (e.g. msvcrtd instead of msvcrt). Since side by side versioning it's become difficult to distribute the debug runtime, even for testing, although you shouldn't really be doing this. So the answer is to either only distibute the release build, as you've done, or to install the debug runtime on the target.
Stu Mackellar
A: 

Similarly, any other DLLs or libraries that this EXE needs will need copying across if they are not present on the target system. This message appears on Vista/7 machines if required libraries are missing or corrupt.

_J_