Saturday, June 5, 2010

Api win32. "Application has failed to start because the applicati..

Hello friends,
sometimes I need light applications which, say, must start at windows startup. In these cases I recur to the win32 api . But, with Visual c++ 2008 I encountered a difficulty which appeared to be very hard to resolve: when I launched an api win32 application on a machine without Visual c++ 2008, the application showed error and I was requested of MSVCR90D.dll and MSVCR90.dll. On a winxp machine the message was "Application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem."
Finally I solved the issue this way:
In release mode:
1)Project menu>Project properties>(if you don't see tree menu scroll toward left)Linker>Link Library Dependencies>No
2)Project menu>Project properties>C/C++>Code Generation>Runtime Library>Multithread (/MT). (This way ). This setting produces a very light executable working in all machines
You have to work always in release mode, because the application in release mode may crash whereas in debug mode it compiles.
Rarely may occur that, in release mode, the application compiles but crashes without
noticing any error. In this case switch to debug mode and you will have more information about the errors. After the debug, switch over again to release mode.

No comments:

Post a Comment