B
B
BonBon Slick2019-12-12 18:15:04
C++ / C#
BonBon Slick, 2019-12-12 18:15:04

Build tools v141 can't be found?

A new cocos2d came out recently, installed a demo project and now I'm trying to build it.
In the 3rd version, there was already a .sln file right away, you immediately need to use a third-party CMake assembler.
Follow the build documentation https://github.com/cocos2d/cocos2d-x/tree/v4/cmake

cd cocos2d-x
mkdir win32-build && cd win32-build
cmake .. -G"Visual Studio 15 2017" -Tv141

Whatever it was, after following the documentation instructions, I get the following error
C:\Users\BonBon.DESKTOP-B1B9CUP\GameDev\Cocos_2D\cocos2d-x-4.0\win32-build>
cmake .. -G"Visual Studio 16 2019" -Tv141
CMake Error at CMakeLists.txt:31 (project):
  Failed to run MSBuild command:

    C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/MSBuild/Current/Bin/MSBuild.exe

  to get the value of VCTargetsPath:

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

    Build started 12/12/2019 5:13:01 PM.
    Project "C:\Users\BonBon.DESKTOP-B1B9CUP\GameDev\Cocos_2D\cocos2d-x-4.0\win32-build\CMakeFiles\3.16.1\VCTargetsPath.vcxproj" on node 1 (default targets).
    C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(379,5): 
error MSB8020: The build tools for Visual Studio 2017 (Platform Toolset = 'v141') cannot be found. To build using the v141 
build tools, please install Visual Studio 2017 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". [C:\Users\BonBon.DESKTOP-B1B9CUP\GameDev\Cocos_2D\cocos2d-x-4.0\win32-
build\CMakeFiles\3.16.1\VCTargetsPath.vcxproj]
    Done Building Project "C:\Users\BonBon.DESKTOP-B1B9CUP\GameDev\Cocos_2D\cocos2d-x-4.0\win32-
build\CMakeFiles\3.16.1\VCTargetsPath.vcxproj" (default targets) -- FAILED.

    Build FAILED.

    "C:\Users\BonBon.DESKTOP-B1B9CUP\GameDev\Cocos_2D\cocos2d-x-4.0\win32-build\CMakeFiles\3.16.1\VCTargetsPath.vcxproj" (default target) (1) ->
    (PrepareForBuild target) ->
      C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(379,5): error MSB8020: The build tools for
 Visual Studio 2017 (Platform Toolset = 'v141') cannot be found. To build using the v141 build tools, please install Visual 
Studio 2017 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". [C:\Users\BonBon.DESKTOP-
B1B9CUP\GameDev\Cocos_2D\cocos2d-x-4.0\win32-build\CMakeFiles\3.16.1\VCTargetsPath.vcxproj]

        0 Warning(s)
        1 Error(s)

    Time Elapsed 00:00:00.13


  Exit code: 1



-- Configuring incomplete, errors occurred!
See also "C:/Users/BonBon.DESKTOP-B1B9CUP/GameDev/Cocos_2D/cocos2d-x-4.0/win32-build/CMakeFiles/CMakeOutput.log".

C:\Users\BonBon.DESKTOP-B1B9CUP\GameDev\Cocos_2D\cocos2d-x-4.0\win32-build>

There are .log
The system is: Windows - 10.0.18362 - AMD64
tools, demo project cocos2d version 3.17 built in VS 2019 with tools v141 works.
  1. Why go to the cocos2d folder instead of the project folder, because you need to build the project and not cocos2d which is already installed in the project?
  2. Why can't tools be found when there are?
  3. And why Failed to run MSBuild?
  4. Why is it talking about the project because it doesn't exist yet, I'm just trying to create a .sln!?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
BonBon Slick, 2019-12-13
@BonBonSlick

https://github.com/cocos2d/cocos2d-x/issues/20411
Pay attention to the comments on the question.
If an error occurs

Unable to start program ....proj.win32\x64\Debug\ALL_BUILD
The system cannot find the file specified

after cmake, already during the build debug, right click in the solution on the project-> set startup project -> replace ALL_BUILD with the name of your program, then make a solution on the project-> clean -> rebuild
Maybe it will help.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question