views:

2913

answers:

2

I'm attempting to build some C++ code that requires the Windows 7.0 SDK header files and libraries. My VC++ Directories is set to:

$(VCInstallDir)include
$(VCInstallDir)atlmfc\include
$(WindowsSdkDir)\include
$(WindowsSdkDir)\common\include
$(FrameworkSDKDir)include

My $(WindowsSdkDir) variable should be set to C:\Program Files\Microsoft SDKs\Windows\v7.0\ -- I've used the SDK's "Visual Studio Registration" configuration tool to set it, and it looks correct in the registry. I've checked under HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows (and the same in Wow6432Node.

Despite this, Visual C++ is still picking up header files from C:\Program Files\Microsoft SDKs\Windows\v6.0A\

What's wrong, and how do I fix it?

+3  A: 

Ah. Found this blog post: http://blogs.msdn.com/windowssdk/archive/2008/06/30/winsdk-bug-notification-sdk-config-tool-appears-to-work-but-fails.aspx

Essentially, the configuration tool only updates the HKEY_LOCAL_MACHINE settings; Visual Studio uses the HKEY_CURRENT_USER settings in preference.

Roger Lipscombe
A: 

If the blog post doesn't work. Try running the vsvars32.bat in your <VS installdir>/Common7/Tools/vsvars32.bat and then run devenv.exe (in the same environment).

mandrake
In order to get that to work, you need to run DEVENV.EXE /USEENV. Useful workaround, but annoying, nonetheless.
Roger Lipscombe