1

I have a very basic program in C++ compiled in VS 11 Beta on windows 7.

All project settings are default except Runtime Library. I changed Multi-threaded DLL (/MD) to Multi-threaded (/MT). This staticly links the runtime library as far as I know.

Trying to run this exe on another windows 7 machine with VS 11 Beta installed works fine.

Trying to run it on a windowx XP machine with no VS installed causes an error popup saying.

"**.exe is not a valid Win32 application"

Is there some settings that need to be changed to make a binary work on XP that was compiled with VS 11 Beta on Win7?

Barış Uşaklı
  • 13,440
  • 7
  • 40
  • 66
  • 3
    Have you compiled a 32bit or 64bit binary? – orlp Apr 10 '12 at 20:09
  • @nightcracker good point. I can't seem to find the x64 setting in the project settings. Did it move somewhere else? – Barış Uşaklı Apr 10 '12 at 20:11
  • 1
    Windows XP is not supported by Visual Studio 11, but you might be able to work around that: http://stackoverflow.com/questions/7702463/what-is-special-about-the-executables-compiled-with-visual-studio-11-which-resul – DCoder Apr 10 '12 at 20:11
  • @DCoder: wow, that makes VS11 pretty useless! – orlp Apr 10 '12 at 20:14
  • @Black - This is the way it has always been. In the project settings, select Configuration Manager, Active platform, and then `` to add x64 as a new target. (Assuming x64 compiler was selected when installing the package). – Bo Persson Apr 10 '12 at 20:28

2 Answers2

6

VS 11 no longer supports Windows XP. This is by design from Microsoft.

http://connect.microsoft.com/VisualStudio/feedback/details/690617

This behavior is by design in MFC and CRT for Visual Studio 11 Beta. The minimum supported operating systems are Windows Server 2008 SP2 and Windows Vista. Windows XP is not a supported operating system for the Beta release (design-time or run-time).

Reading further into the discussion, there's a possibility that Windows XP may be supported in the release version. I wouldn't bank on it though.

Edit: Microsoft have relented: Targeting Windows XP with C++ in Visual Studio 2012

RichieHindle
  • 272,464
  • 47
  • 358
  • 399
Mark Ransom
  • 299,747
  • 42
  • 398
  • 622
2

Probably you compiled for 64 bit Windows. Windows XP, however, only supports 32 bit code.

celtschk
  • 19,311
  • 3
  • 39
  • 64