tags:

views:

85

answers:

3

I've built a C++ application using MSVC 2010, default compile settings (note: Using "Multithreaded" instead of "Multithreaded DLL" to avoid the Microsoft C++ runtime being needed).

I used only the STL and a few, old functions from the Win32 API (Windows.h).

  • Where will my app run? (98-7?)
  • Can the be any differences on how my app works on different PCs? As said: It's only a simple console app.

I'd be glad if you could add some additional information if you have it!

+1  A: 

Take a look at "Using the Windows Headers" at MSDN. It describes how to configure the windows header files to support various mixtures of OS's.

dkackman
A: 

I think you have to think about it the other way, what versions of Windows do you need to support, and then you can check if the APIs you need are supported or if you have to find workarounds. After seeing Chris' comment about Win9x no longer being supported I took a look and discovered that the 2010 redist package only supports WinXP and upwards, so you might not be able to compile for Win 2000 either now?

ho1
+3  A: 

The Simplest answer is: Your app will run on Windows versions 5.0 and later - depending on what other APIs YOU use.

the hard limit of 5.0 is introduced in Visual C++ 2008 that stamps a 5 into the minimum OS version field in all the PE headers of all the executable files it produces.

As Windows NT is the only desktop OS with version's 5 and higher, this means that Windows 95, 98, ME cannot run programs made with VS 2008 and VS 2010. Windows 2000 is actually Windows NT 5.0, so it can be targetted. XP is 5.1, Vista 6.0, and in a twist of idiocy, Windows 7 is actually version 6.1 of Windows NT.

Chris Becke
Hardly a "twist of idiocy". The reason the version bump was only minor was to help retain backwards compatibility with applications that perform poorly written version checking.The 'idiocy' is on the part of the developers who wrote said applications.
RaptorFactor
Oh, wanted to add as a second point, that manually 'filtering' the APIs you use based on minimum version you wish to support is a fairly ugly 'solution'. By doing what 'dkackman' suggested you can have the compiler enforce version constraints for you, then LL and GPA anything that can't be statically imported.
RaptorFactor