Application has failed to start

"Application has failed to start because the application configuration is incorrect"

I am compiling and running successfully my program with VS 2008 express on three computers that have VS installed. I get the above error message when I download the .exe and run on a computer that does not have VS installed. I use only windows.h. Any hints what should I do?

Thanks in advance!
You are running under Windows XP.
You are linking dynamically to the runtime as opposed to linking statically.
You are generating and embedding a manifest when compiling and linking.

The most straightforward approach: Go to http://download.microsoft.com and search for the VC++ 2008 Redistributable package. This is the C++ runtime used by Visual Studio 2008. Your application will only run in computers that have the runtime for 2008 installed.

Alternative approach: Statically link against the runtime and don't generate a manifest file. To be honest, I wouldn't remove the manifest file unless static linking doesn't work by itself. Try before you remove.
Thanks a lot for the quick reply! I want to do the static linking approach.

I was browsing the MS sites and they advised that I switch code generation to /MT option. As soon as I did that, I got a myriad of Linker errors:

example.obj : error LNK2005: "public: void __thiscall std::basic_stringstream<char,struct std::char_traits<char>,class std::allocator<char> >::`vbase destructor'(void)" (??_D?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ) is already defined in msvcprtd.lib(MSVCP90D.dll) .

What am I doing wrong?
Thanks!

[Edit:]

Figured it all out!

Had to add

libcmtd.lib

to the debugger options. The interesting part was that none of the forums online suggested me that I do so. How I figured it: I got a linker error

libcpmtd.lib(xmbtowc.obj) : error LNK2001: unresolved external symbol Symbol "__free_dbg".

Then I figured I might as well add libcmtd.lib in the concoction and it worked. Go figure.
Last edited on
Topic archived. No new replies allowed.