VS2012: c:\program files\microsoft sdks\windows\v7.1\include\sal_supp.h(57): warning C4005: '__useHeader' : macro redefinition
-
Monday, October 22, 2012 8:48 AM
Just making my first steps with VS2012. But it fails by default. I get following errors when compiling a *newly* created MFC project:
1>------ Build started: Project: Test2012, Configuration: Debug Win32 ------
1> stdafx.cpp1>c:\program files\microsoft sdks\windows\v7.1\include\sal_supp.h(57): warning C4005: '__useHeader' : macro redefinition
1> m:\program files (x86)\microsoft visual studio 11.0\vc\include\sal.h(2872) : see previous definition of '__useHeader'
1>c:\program files\microsoft sdks\windows\v7.1\include\specstrings_supp.h(77): warning C4005: '__on_failure' : macro redefinition
1> m:\program files (x86)\microsoft visual studio 11.0\vc\include\sal.h(2882) : see previous definition of '__on_failure'
1>m:\program files (x86)\microsoft visual studio 11.0\vc\atlmfc\include\atlcore.h(638): error C2039: 'SetDefaultDllDirectories' : is not a member of '`global namespace''
1>m:\program files (x86)\microsoft visual studio 11.0\vc\atlmfc\include\atlcore.h(638): error C2065: 'SetDefaultDllDirectories' : undeclared identifier
1>m:\program files (x86)\microsoft visual studio 11.0\vc\atlmfc\include\atlcore.h(640): error C2065: 'LOAD_LIBRARY_SEARCH_SYSTEM32' : undeclared identifier
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I've seen a similar thread:
http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/a7fd6119-825a-4d9a-9570-7b9cf6ed1bc6
But it doesn't work for me...
Adjusting the project's include paths seems to get ignored. I changed it from:
$(VCInstallDir)PlatformSDK\include;C:\Program Files\Microsoft SDKs\Windows\v7.1\Include;$(IncludePath)
to:
$(VCInstallDir)PlatformSDK\include;C:\Program Files (x86)\Windows Kits\8.0;$(IncludePath)
at:
project properties > configuration properties > VC++ Directories
But nothing changed. Even though I removed the "7.1" for the directories, it is STILL listed in errors as shown above.
So weird.
How do include directories work with VS2012?
Why does it fail by default on my PC?
Thanks!
All Replies
-
Tuesday, October 23, 2012 2:48 AMModerator
Hi ITSTH,
Welcome here.
How do include directories work with VS2012?
Based on my understanding, you should check and change the “Platform Toolset” to “Visual Studio 2012 (v110)” in “Configuration Properties -> General”.
Since, PlatformSDK is early version Windows SDK. Do you intend to use it? If not, I suggest you change the order of the Include Directories, so that you can use the new Windows 8.0 SDK. Move the “$(VCInstallDir)PlatformSDK\include;” to the end of this list or delete it.
Moreover, as you done in your post, specify your Windows Kits 8.0 path in the Include Directories; in my computer it is enveloped in “$(WindowsSDK_IncludePath)”.
Then, try again.
Why does it fail by default on my PC?
I have not encountered your issue. I have installed Visual Studio 2012, Visual studio 2010 and Visual studio 2008 on the same computer. They all work well. Maybe there happens something wrong when you install it.
Have a nice day.
Regards,
Elegentin Xie [MSFT]
MSDN Community Support | Feedback to us
- Proposed As Answer by Elegentin XieMicrosoft Contingent Staff, Moderator Wednesday, October 24, 2012 2:09 AM
- Marked As Answer by Elegentin XieMicrosoft Contingent Staff, Moderator Tuesday, October 30, 2012 6:58 AM
-
Tuesday, October 23, 2012 8:38 AM
Hi Elegentin,
thanks for your answer.
> change the “Platform Toolset” to “Visual Studio 2012 (v110)”
I checked that, but it already had that value. But it was still the right point. I changed it to "Visual Studio 2012 - Windows XP (v110_xp)" and the compile suddenly worked!!!
Great! Thanks!
BTW, I also tried changing it to "Visual Studio 2008 - (v90)" (which I haven't installed), and that removed all my project setting pages. I was even unable to change it back again because the page was gone. Quite a dangerous option. MS needs to do some more work here, I think...
Thanks again,
Thomas- Proposed As Answer by Elegentin XieMicrosoft Contingent Staff, Moderator Wednesday, October 24, 2012 2:09 AM
- Marked As Answer by Elegentin XieMicrosoft Contingent Staff, Moderator Tuesday, October 30, 2012 6:58 AM
-
Wednesday, October 24, 2012 2:09 AMModerator
Hi,
You are welcome.
Based on your description, your Operating System may be Windows XP. I have only tested changing Platform Toolset in Windows 7.
Yes, you are right. In order to target Windows XP, switch from the default v110 toolset to the newly introduced v110_xp toolset inside your project’s property pages. See more: here .
Have a nice day.
Regards,
Elegentin Xie [MSFT]
MSDN Community Support | Feedback to us
- Marked As Answer by Elegentin XieMicrosoft Contingent Staff, Moderator Tuesday, October 30, 2012 6:59 AM
-
Tuesday, October 30, 2012 7:01 AMModerator
Hi,
I have marked these replies as answers.
If you disagree, please unmark them, and post your doubt.Regards,
Elegentin Xie [MSFT]
MSDN Community Support | Feedback to us

