This article describes what you need to do to build Win32 applications using Visual C++ Express and the Windows SDK for Windows Server 2008 and .NET Framework 3.5.  A shortened, quick-start version of this article (without screenshots) can be found here. You can also read the blog post Integrating Windows SDK and VS with new SDK Configuration tool for more information on the Windows SDK Configuration tool. This article describes the use of the Windows SDK Configuration tool, including how it works.

 

A serious bug has been discovered with the Windows SDK Configuration Tool.  This bug is not apparent as the tool appears to work correctly.  Please read the blog post WinSDK bug notification: SDK Config Tool appears to work but fails, to learn more about the issue and find workaround steps.

 

You probably know that you can use Visual C++ Express to build .NET Framework applications immediately after installation.  With the Visual Studio 2008 Express versions you can also build Win32 applications right out of the box.  You no longer have to manually integrate the Windows SDK content with VC++ Express. 

The Visual Studio 2008 editions are seamlessly integrated with the Windows SDK.  VS2008 editions have the same Vista RTM headers and libraries that shipped in the Microsoft Windows  Software Development Kit Update for Windows Vista released in March, 2007. The SDK tools that ship with VS2008 editions are more recent than those that ship in the Vista Update SDK. 

 install_Express - Share on Ovi

Updating the Windows SDK Content in Visual C++2008 Express

You can build Win32 applications right out of the box with the Vista RTM headers and libraries.  If you installed the Windows SDK for Windows Server 2008 and .NET Framework 3.5 after you installed VS, you are ready to develop with the headers, libraries and tools in the SDK for Windows Server 2008.  If you installed the Windows Server 2008 SDK before you install Visual Studio, you will need to use the SDK Configuration Tool to set the directories.

 

Step 1: Install Microsoft Visual C++ 2008 Express.

Step 2: Install the Windows SDK for Windows Server 2008 and .NET Framework 3.5.

In most cases you should install the latest Windows SDK.  The Windows SDK MSDN Developer Center is the place to find out the latest releases, read the release notes and link other SDK resources.  The Windows SDK team blog is another good place to check for breaking news, workarounds and interesting discussion. 

 At the time this article was written, the latest SDK was the Windows SDK for Windows Server 2008 and .NET Framework 3.5.  This SDK release supports Windows Server 2008, .NET Framework 3.5, and Windows Vista SP1 and is compatible with Visual Studio 2008 and Visual Studio 2005 SP1; including Visual Studio Express Editions.  You can install this SDK on Windows Vista, Windows Server 2008, Windows Server 2003 or Windows XP SP2.

 After installing the Windows SDK, you’ll have two sets of SDK resources installed to your hard drive by default to C:\Program Files\Microsoft SDKs\Windows\:

·         \v6.0A contains the SDK resources installed by Visual Studio 2008 Express

·         \v6.1 contains the SDK resources installed by the Windows SDK for Windows Server 2008

Directory - Share on Ovi

If you installed the Windows SDK for Windows Server 2008 and .NET Framework 3.5 after you installed VS, you are ready to develop with the headers, libraries and tools in the SDK for Windows Server 2008. After installing the Server 2008 SDK, the registry key is set to point to the new Server 2008 SDK (v6.1) content. 

 

 If you installed the Windows Server 2008 SDK before you installed Visual Studio, you will need to use the SDK Configuration Tool to set the directories.  The registry key will be set to point to the default (Vista v6.0A) headers and libraries that were installed with VS 2008.  If you want to switch to the new Server 2008 SDK (v6.1) content, you should use the new SDK Configuration Tool to select the v6.0A SDK content.

launchSDKconfig - Share on Ovi

sdkconfigTool - Share on Ovi

Step 3: Use the SDK Configuration Tool to update the Visual C++ directories to point to the Windows SDK headers, libraries and tools.

·         The Visual Studio Library Directory sets the paths to use when searching for library files while building a VC++ project.  It corresponds to environment variable LIB. 

·         The Visual Studio Include Directory sets the paths to use when searching for include files while building a VC++ project.  It corresponds to environment variable INCLUDE. 

·         The Visual Studio Executables Directory sets the path to use when searching for executable files while building a VC++ project.  It corresponds to environment variable PATH.

 

The VC++ 2008 Library, Include and Tool path are set on install to the Windows SDK v6.0A content that ships embedded with Visual Studio 2008. 

VCInclude Dir - Share on Ovi

The Windows SDK for Windows Server 2008 includes a new SDK Configuration Tool that sets the Visual Studio directories for you.  This tool lets you switch quickly between the headers, libraries and tools in the SDK for Windows Server 2008 and those that are embedded in Visual Studio.

 

 The SDK Configuration Tool has a GUI interface but it works only on the Visual Studio Retail (non-Express) SKUs. (This is scheduled to be fixed in the next release.)  You can use the SDK Configuration tool at the command line with VC++ Express.

 

1.       Launch the Windows SDK Command Window (Start, All Programs, Microsoft Windows SDK v6.1, Command Window)

2.       CD to \Program Files\Microsoft\Windows\v6.1\Setup>

3.       Type:  WindowsSdkVer.exe -version:v6.1

SDKcmdWindow - Share on Ovi

This command will set the Windows SDK for Windows Server 2008 (v 6.1) as the “current” SDK for Visual Studio to use for headers, libraries and tools.  Use ‘-version:v6.1’ for the Windows Server 2008 SDK content.  Use ‘-version:v6.0A’ for the Visual Studio 2008 content.  You’re done!

 

CMDwinConfirm - Share on Ovi

Step 4: How to validate that the Directories were updated.

Open the VC++ Express command window and check the PATH to see if the v6.1 directory has been added:

1.       Start, All Programs, Visual C++ Express Edition 9.0, Visual Studio Tools, Visual Studio 2008 Command Prompt

2.       At the prompt, type: PATH

 verify - Share on Ovi

How to Switch back to the SDK content that shipped ‘in the box’ with VC++ 2008 Express

To restore the default directories, use the SDK Configuration Tool at the command line to make the v6.0A directories ‘current.’

 

1.       Launch the Windows SDK Command Window (Start, All Programs, Microsoft Windows SDK v6.1, Command Window)

2.       CD to \Program Files\Microsoft\Windows\v6.1\Setup>

3.       Type:  WindowsSdkVer.exe -version:v6.0A

 

Troubleshooting:

 

After Visual Studio Repair, environment variables are reset.  If Visual Studio is Repaired (through Add/Remove Programs), the environment variables will point back to the default VS content.  You will need to use the SDK Configuration tool if you want to point to the content in the Windows Server 2008 SDK.

 

After Windows SDK Repair, environment variables are reset. If the Windows SDK is Repaired (through Add/Remove Programs), the environment variables will point to Windows SDK content.  You will need to use the SDK Configuration tool if you want to point to the content that shipped with Visual Studio 2008.