Airsim: Build error

Created on 6 Dec 2017  路  6Comments  路  Source: microsoft/AirSim

Updating submodules...
fatal: Not a git repository (or any of the parent directories): .git
Starting cmake...
-- Selecting Windows SDK version to target Windows 10.0.15063.
CMake Error at CMakeLists.txt:2 (project):
Failed to run MSBuild command:

MSBuild.exe

to get the value of VCTargetsPath:

Microsoft (R) Build Engine version 15.4.8.50001 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 2017/12/6 17:23:44.
Project "D:\Jack\AirSim-1.1.7\external\rpclib\build\CMakeFiles\3.10.0\VCTargetsPath.vcxproj" on node 1 (default targets).
D:\IDE\VS\Common7\IDE\VC\VCTargets\Microsoft.Cpp.Platform.targets(57,5): error MSB8020: The build tools for v140 (Platform Toolset = 'v140') cannot be found. To build using the v140 build tools, please install v140 build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [D:\Jack\AirSim-1.1.7\external\rpclib\build\CMakeFiles\3.10.0\VCTargetsPath.vcxproj]
Done Building Project "D:\Jack\AirSim-1.1.7\external\rpclib\build\CMakeFiles\3.10.0\VCTargetsPath.vcxproj" (default targets) -- FAILED.

Build FAILED.

"D:\Jack\AirSim-1.1.7\external\rpclib\build\CMakeFiles\3.10.0\VCTargetsPath.vcxproj" (default target) (1) ->
(PlatformPrepareForBuild target) ->
  D:\IDE\VS\Common7\IDE\VC\VCTargets\Microsoft.Cpp.Platform.targets(57,5): error MSB8020: The build tools for v140 (Platform Toolset = 'v140') cannot be found. To build using the v140 build tools, please install v140 build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [D:\Jack\AirSim-1.1.7\external\rpclib\build\CMakeFiles\3.10.0\VCTargetsPath.vcxproj]

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.10

Exit code: 1

-- Configuring incomplete, errors occurred!
See also "D:/Jack/AirSim-1.1.7/external/rpclib/build/CMakeFiles/CMakeOutput.log".
Microsoft (R) Build Engine version 15.4.8.50001 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

MSBUILD : error MSB1009: Project file does not exist.
Switch: ALL_BUILD.vcxproj
Microsoft (R) Build Engine version 15.4.8.50001 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

MSBUILD : error MSB1009: Project file does not exist.
Switch: ALL_BUILD.vcxproj

Build failed

D:\Jack\AirSim-1.1.7>build.cmd
Updating submodules...
fatal: Not a git repository (or any of the parent directories): .git
Starting cmake...
-- Selecting Windows SDK version to target Windows 10.0.15063.
CMake Error at CMakeLists.txt:2 (project):
Failed to run MSBuild command:

MSBuild.exe

to get the value of VCTargetsPath:

Microsoft (R) Build Engine version 15.4.8.50001 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 2017/12/6 17:43:43.
Project "D:\Jack\AirSim-1.1.7\external\rpclib\build\CMakeFiles\3.10.0\VCTargetsPath.vcxproj" on node 1 (default targets).
D:\IDE\VS\Common7\IDE\VC\VCTargets\Microsoft.Cpp.Platform.targets(57,5): error MSB8020: The build tools for v140 (Platform Toolset = 'v140') cannot be found. To build using the v140 build tools, please install v140 build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [D:\Jack\AirSim-1.1.7\external\rpclib\build\CMakeFiles\3.10.0\VCTargetsPath.vcxproj]
Done Building Project "D:\Jack\AirSim-1.1.7\external\rpclib\build\CMakeFiles\3.10.0\VCTargetsPath.vcxproj" (default targets) -- FAILED.

Build FAILED.

"D:\Jack\AirSim-1.1.7\external\rpclib\build\CMakeFiles\3.10.0\VCTargetsPath.vcxproj" (default target) (1) ->
(PlatformPrepareForBuild target) ->
  D:\IDE\VS\Common7\IDE\VC\VCTargets\Microsoft.Cpp.Platform.targets(57,5): error MSB8020: The build tools for v140 (Platform Toolset = 'v140') cannot be found. To build using the v140 build tools, please install v140 build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [D:\Jack\AirSim-1.1.7\external\rpclib\build\CMakeFiles\3.10.0\VCTargetsPath.vcxproj]

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.12

Exit code: 1

Most helpful comment

For anyone still having the issue, I just solved the problem like this,
Turns out when you run Native Tools Command Prompt as Administrator, the default location you end up in is

  • C:\Windows\System32

However, you want to clone and build AirSim in

  • C:\Program Files\Visual Studio 2017\Community

When you follow the rest of the steps,

  • cd AirSim
  • build.cmd

It works out perfectly.

All 6 comments

Are you using VS2015? In that case, are you running build from VS2015 Native Tools x64 Command Prompt?

I installed both vs15 and 17. I did use VS2015 Native Tools x64 Command Prompt to run build.cmd. Is it because of the CMake version? Mine is 3.10.

I clone the AirSim in the VS2017 Native Tools x64 Command Prompt agian and it works now.

I have the same issue as you! I follow the guidance to build but it still does not work

For anyone still having the issue, I just solved the problem like this,
Turns out when you run Native Tools Command Prompt as Administrator, the default location you end up in is

  • C:\Windows\System32

However, you want to clone and build AirSim in

  • C:\Program Files\Visual Studio 2017\Community

When you follow the rest of the steps,

  • cd AirSim
  • build.cmd

It works out perfectly.

To those trying to use Visual Studio 2019, I have not figured out a way to make that version work for builds. I ended up installing VS 2017 along side VS 2019. This seems to work. You just need to be careful to launch the right version of the "x64 Native Tools Command Prompt". From the Windows Start menu, look for the version named "x64 Native Tools Command Prompt for VS 2017". In my case, I also had to launch it as administrator by right-clicking on the app name and choosing "Run as administrator".

Was this page helpful?
0 / 5 - 0 ratings