I'm running Windows 7 and Visual Studio 2008 Pro and trying to get my application to work on Windows XP SP3.
It's a really minimal command line program so should have any ridiculous dependencies:
// XPBuild.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
int _tmain(int argc, _TCHAR* argv[])
{
printf("Hello world");
getchar();
return 0;
}
I read somewhere that defining several constants such as WINVER should allow me to compile for other platforms. I've tried the added the following to my /D
compiler options:
;WINVER=0x0501;_WIN32_WINNT 0x0501;NTDDI_VERSION=NTDDI_WINXP
But that made no difference. When I run it on my Windows XP machine (actually running in a virtualbox) I get the following error:
This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.
So what have I missed? Is there something else required to run MSVC compiled programs or a different compiler option or something else?
What you have missed is most likely that VC++ programs require a runtime to be installed (unless you link statically, which is not the default) - the error message you show is exactly the one you get if they're not in order.
Try installing the Microsoft Visual C++ 2008 SP1 Redistributable Pack on the XP machine - you will most likely see that your program works with no changes whatsoever.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With