Wednesday, March 19, 2008

Importance of WINVER definition in Visual Studio 2008

(Mar 19, 2008)

Recently, MIPL starts to port stuff to VS 2008. It turns out that code compiled on Vista worked 100% correct only on Vista, but on Windows XP, it showed some glitches.

This is because the default WINVER in VS 2008 is 0x0600 (Vista). Thus, when we build our code, it will perform some Vista specific links, and an executable file may not work correctly on XP.

To solve this problem, just go to StdAfx.h and put the definition of WINVER to XP:

#define WINVER 0x0501

With this definition, built executable files should work on both XP and Vista.

No comments: