How to build with v90 platform toolset in VS2012 without VS2008, using Windows SDK?

后端 未结 3 599
眼角桃花
眼角桃花 2020-12-08 17:07

I use Visual Studio 2012 and this is the only version of Visual Studio I have installed. I need to build certain C++ projects with the v90 platform toolset (of Visual Studio

3条回答
  •  北海茫月
    2020-12-08 17:46

    In addition to this answer I want to add that

    1. You can install SDK 7.0 simply by running setup, there is no problem with it.
    2. You can install SDK 7.1 by running setup, if you remove Microsoft Visual C++ 2010 Redistributables first and fix following registry values:

      [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Client]
      "Version"="4.0.30319"
      
      [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full]
      "Version"="4.0.30319"
      
      [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\NET Framework Setup\NDP\v4\Client]
      "Version"="4.0.30319"
      
      [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\NET Framework Setup\NDP\v4\Full]
      "Version"="4.0.30319"
      

      You can (and probably should) restore these values to whatever they originally were after installation is complete.

      Do not forget to install KB2519277 after this, it updates compilers in SDK 7.1 to SP1.

    3. You don't need to copy any dll. MSBuild uses

      HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Setup\VC@ProductDir
      HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\9.0\Setup\VC@ProductDir
      HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Setup\VS@ProductDir
      HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\9.0\Setup\VS@ProductDir
      

      to set up paths. It's probably wise to fix them to point to "C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\" and "C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\" as it might be useful elsewhere in build process.

      Same goes for version 10.0 if you plan to use Windows7.1SDK toolset.

    4. Use WindowsSdkVer.exe to set current SDK to 7.1 to defeat cryptic error in Microsoft.Cpp.x64.Targets(63,5) about missing unnamed required file. If the tool gives you error, then set these values manually:

      HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows@CurrentInstallFolder
      HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows@CurrentInstallFolder
      

      to point to newly installed SDK. The tool needs some registry keys from Visual Studio installation to work properly, but there are many and I'm not sure which are important.

    5. Reboot. None of the above asks you to, but without reboot I got errors when trying to build a project.

    6. As an aside, SDK7.1 adds v100 toolset, but it won't work, saying something about Could not find WindowsSDKDir variable from the registry. This is because v100 actually requires SDK7.0A which comes with Visual Studio 2010 and is not available separately. Windows7.1SDK toolset is the one which utilises VC2010 compilers if you need them.

    7. Microsoft.Cpp.Win32.*.props files have a lot of relevant stuff if something fails in build system.

提交回复
热议问题