3

I'm trying to build project c++ on vs2017 but there error appear: "The build tools for Visual Studio 2008 (Platform Toolset = 'v90') cannot be found " after navigation, I must download VS 2008 I have installed it, but problem still exist . any Suggestion ?

ivan_pozdeev
  • 28,628
  • 13
  • 85
  • 130

3 Answers3

4

The projects are targeting the v90 platform toolset. The solution is to either open the .sln file with VS2008 (i.e. use the right tool), or spend some time updating the projects to target the latest platform toolset (i.e. VS2017). To do that, just right click each project, and go to Properties, then look at General | Windows SDK Version. You may have to fix compilation / linker errors following the project upgrade.

Mark Ingram
  • 65,792
  • 48
  • 164
  • 225
4

You need:

  • An MSVC 9.0 compiler toolchain
    • https://wiki.python.org/moin/WindowsCompilers lists the products that have it:
      • VS 2008, "Visual C++" feature and "x64 compilers and tools" subfeature
        • Express edition only has x86 compilers
        • Do install SP1 on top of VS2008 -- in vanilla VS2008 installer, installation for many features, including x64 compilers, is broken
      • WinSDK 6.1
      • WinSDK 7.0
      • "Visual C++ Compiler for Python 2.7" package
  • MsBuild 4.0 toolset configuration files for the above toolchain. (These are the directories c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\<arch>\PlatformToolsets\v90\ with .props and .targets files in them)

    • The only product I know that has this package is VS 2010 ("Visual C++" feature and "x64 compilers and tools" subfeature).
    • (WinSDK 7.1 technically has it, too, but its setup is riddled with bugs and broken on an x64 system.)
      • (You can bypass the buggy installer though if you install <GRMSDK_EN_DVD.iso>\Setup\vc_stdx86\vc_stdx86.msi directly. Despite the name, it has toolset files for all 3 platforms.)


    "Visual C++ Compiler for Python 2.7" package is not supported by these toolset configuration files. So if you use it, you'll need to either manually specify its location in one of registry values specified in .props, or modify .props to also look in HKLM\Software\Microsoft\DevDiv\VCForPython.

ivan_pozdeev
  • 28,628
  • 13
  • 85
  • 130
  • Not sure why you're adding all this Python info, the question doesn't mention Python at all – Hong Ooi Aug 11 '19 at 22:10
  • 1
    @HongOoi It's just a coincidence. Python 2.7 is officially compiled with VC90 in Windows so they have useful stuff on this matter. – ivan_pozdeev Aug 12 '19 at 05:47
1

It is possible to upgrade the project file from the command line without opening it in Visual Studio. I was running into the same issue, and found another solution in the Microsoft documentation for Visual Studio (https://docs.microsoft.com/en-us/visualstudio/ide/reference/upgrade-devenv-exe?view=vs-2017).

Here are the steps:

  1. Open the developer command prompt for you version of Visual Studio, e.g. 'Developer Command Prompt for VS 2017'.
  2. Navigate to the directory of your project file.
  3. Execute the following command: devenv myproject.sln /upgrade
Mr. Dice
  • 51
  • 2
  • 7