Question

I'm new to c++. I made a c++ program using VS 2008 Professional. I started with the Win32 template that created a window for me. I compiled it on Vista 32. I brought the compiled exe to my old XP sp2 computer, and it tells me the application configuration is incorrect. Is there something im doing wrong? How do I make it platform independent?

Thanks

Was it helpful?

Solution

Try installing Microsoft Visual C++ 2008 SP1 Redistributable Package and make sure you use the release build of your application.

OTHER TIPS

Make sure that WINVER is set to a version that includes WinXP - it looks like the default target version of Windows for VS 2008 is Vista (0x0600).

Set the following preprocessor define:

#define WINVER 0x0501

preferably using the Project Properties "C/C++/Preprocessor/Preprocessor Definitions" or the -D option on the cl.exe command line. It's also possible that there's a targetver.h file that has this setting (depending on how your project got created initially).

See http://msdn.microsoft.com/en-us/library/aa383745(VS.85).aspx for more details.

Your target system is missing the needed runtime files for that executable.

You can find it at: Microsoft Visual C++ 2008 Redistributable Package (x86) or Microsoft Visual C++ 2008 SP1 Redistributable Package (x86)

You could use Dependency Walker to find which components lacks on target WinXP system. Then you should install appropriate redistributables.

In project properties, set "C/C++ -> Code Generation -> Runtime Library" to "Multi-threaded (Debug)". After you rebuild, the application will no longer depend on msvcr90.dll. The application binary will, however, be somewhat larger.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top