我设法解决了这个问题,虽然我仍然不确定它的来源,为什么首先 VStudio 安装程序无法正确设置它?
您将需要根据您的安装添加两个具有适当值的注册表字符串(在我的情况下为 C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include & Lib\x64)
Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A@IncludeFolder
Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A@LibFolder
并将这两行添加到文件 Microsoft.Cpp.x64.v100.props 以引用注册表项,此解决方案也适用于 v7.1 Sdk
<WindowsSDK_IncludePath Condition="'$(UseEnv)' != 'true'">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A@IncludeFolder) </WindowsSDK_IncludePath>
<WindowsSDK_IncludePath Condition="'$(WindowsSDK_IncludePath)' == ''">$(WindowsSdkDir)Include</WindowsSDK_IncludePath>
<WindowsSDK_LibraryPath_x64 Condition="'$(UseEnv)' != 'true'">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A@LibFolder)</WindowsSDK_LibraryPath_x64>
<WindowsSDK_LibraryPath_x64 Condition="'$(WindowsSDK_LibraryPath_x64)' == ''">$(WindowsSdkDir)Lib\x64</WindowsSDK_LibraryPath_x64>
在此更改后,宏将出现在 LibDir 和 IncludeDir 的列表中,并且 x64 编译将起作用。如果有人用默认的 SDK7.0A 安装 VStudio2010 并工作,这个文件看起来如何,这将是一个很好的参考。