microsoft / WSL-DistroLauncher

Sample/reference launcher app for WSL distro Microsoft Store packages.
MIT License
1.67k stars 517 forks source link

Building distro-launcher failing #105

Closed mousumih closed 2 years ago

mousumih commented 2 years ago

I am using git clone https://github.com/microsoft/WSL-DistroLauncher.git and then run build.bat from a Visual 2017 command prompt. I am seeing the following errors. I have VS2017 Professional installed in my platform. Please can you tell me what I am doing wrong?

Thank you Mousumi

build.bat Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework Copyright (C) Microsoft Corporation. All rights reserved.

Build started 2/10/2022 11:20:02 AM. 1>Project "c:\Users\mmh\WSL-DistroLauncher\DistroLauncher.sln" on node 1 (Build target(s)). 1>ValidateSolutionConfiguration: Building solution configuration "Debug|x64". 1>Project "c:\Users\mmh\WSL-DistroLauncher\DistroLauncher.sln" (1) is building "c:\Users\mmh\WSL-DistroLauncher\Di stroLauncher\DistroLauncher.vcxproj" (2) on node 1 (default targets). 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.Cpp.Platform .targets(67,5): error MSB8020: The build tools for v142 (Platform Toolset = 'v142') cannot be found. To build us ing the v142 build tools, please install v142 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\mmh\WSL-DistroLauncher\DistroLauncher\DistroLauncher.vcxproj] 2>Done Building Project "c:\Users\mmh\WSL-DistroLauncher\DistroLauncher\DistroLauncher.vcxproj" (default targets) -- FAILED. 1>Done Building Project "c:\Users\mmh\WSL-DistroLauncher\DistroLauncher.sln" (Build target(s)) -- FAILED.

Build FAILED.

   "c:\Users\mmh\WSL-DistroLauncher\DistroLauncher.sln" (Build target) (1) ->
   "c:\Users\mmh\WSL-DistroLauncher\DistroLauncher\DistroLauncher.vcxproj" (default target) (2) ->
   (PlatformPrepareForBuild target) ->
     C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.Cpp.Platfo
   rm.targets(67,5): error MSB8020: The build tools for v142 (Platform Toolset = 'v142') cannot be found. To build
   using the v142 build tools, please install v142 build tools.  Alternatively, you may upgrade to the current Visu
   al Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution
   ". [c:\Users\mmh\WSL-DistroLauncher\DistroLauncher\DistroLauncher.vcxproj]

0 Warning(s)
1 Error(s)
Biswa96 commented 2 years ago

Either update to Visual Studio 2022 or change the build tools version in project settings.

mousumih commented 2 years ago

Either update to Visual Studio 2022 or change the build tools version in project settings.

I updated to Visual Studio 2022 and still see this issue error MSB8020: The build tools for Visual Studio 2017 (Platform Toolset = 'v141') - even though I have installed the 2017 toolset.

In the project settings for DisplayLauncher-Appx I try to change the platform toolset, but whatever I change to says not found. Launcher builds fine.

Mousumi

build.bat Microsoft (R) Build Engine version 17.0.0+c9eb9dd64 for .NET Framework Copyright (C) Microsoft Corporation. All rights reserved.

Build started 2/10/2022 9:07:08 PM. 1>Project "c:\Users\mmh\WSL-DistroLauncher\DistroLauncher.sln" on node 1 (Build target(s)). 1>ValidateSolutionConfiguration: Building solution configuration "Debug|x64". 1>Project "c:\Users\mmh\WSL-DistroLauncher\DistroLauncher.sln" (1) is building "c:\Users\mmh\WSL-DistroLauncher\Di stroLauncher\DistroLauncher.vcxproj" (2) on node 1 (default targets). 2>InitializeBuildStatus: Creating "x64\Debug\launcher.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified. CustomBuild: Compiling Messages... MC: Compiling c:\Users\mmh\WSL-DistroLauncher\DistroLauncher\messages.mc 2>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets (242,5): warning MSB8065: Custom build for item "messages.mc" succeeded, but specified output "c:\users\mmh\wsl- distrolauncher\distrolauncher\msg0409.bin" has not been created. This may cause incremental build to work incorr ectly. [c:\Users\mmh\WSL-DistroLauncher\DistroLauncher\DistroLauncher.vcxproj] ClCompile: C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.30.30705\bin\HostX86\x64\CL.exe /c /ZI /JMC /nologo /W3 /WX- /diagnostics:column /sdl /Od /D _DEBUG /D _CONSOLE /D _UNICODE /D UNICODE /Gm- /EHs c /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /std:c++17 /Yc"stdafx.h" /Fp"x64\Debug\launch er.pch" /Fo"x64\Debug\" /Fd"x64\Debug\vc143.pdb" /external:W3 /Gd /TP /FC /errorReport:queue stdafx.cpp stdafx.cpp C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.30.30705\bin\HostX86\x64\CL.exe /c /ZI /JMC /nologo /W3 /WX- /diagnostics:column /sdl /Od /D _DEBUG /D _CONSOLE /D _UNICODE /D UNICODE /Gm- /EHs c /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /std:c++17 /Yu"stdafx.h" /Fp"x64\Debug\launch er.pch" /Fo"x64\Debug\" /Fd"x64\Debug\vc143.pdb" /external:W3 /Gd /TP /FC /errorReport:queue DistributionInfo .cpp Helpers.cpp DistroLauncher.cpp WslApiLoader.cpp DistributionInfo.cpp Helpers.cpp DistroLauncher.cpp WslApiLoader.cpp Generating Code... ResourceCompile: C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0\x86\rc.exe /D _UNICODE /D UNICODE /l"0x0409" /nologo / fo"x64\Debug\DistroLauncher.res" DistroLauncher.rc Link: C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.30.30705\bin\HostX86\x64\link.exe /ERRORREPORT:QUEUE /OUT:"c:\Users\mmh\WSL-DistroLauncher\x64\Debug\launcher.exe" /INCREMENTAL /ILK:"x64\Debug\ launcher.ilk" /NOLOGO onecore.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG /PDB:"c:\Users\mmh\WSL-DistroLauncher\x64\Debug\launcher.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"c:\Users\mmh\WSL-DistroLauncher\x64\Debug\launcher.lib" /MACHINE:X64 x64\Debug\DistroLaunch er.res x64\Debug\DistributionInfo.obj x64\Debug\Helpers.obj x64\Debug\DistroLauncher.obj x64\Debug\stdafx.obj x64\Debug\WslApiLoader.obj DistroLauncher.vcxproj -> c:\Users\mmh\WSL-DistroLauncher\x64\Debug\launcher.exe FinalizeBuildStatus: Deleting file "x64\Debug\launcher.tlog\unsuccessfulbuild". Touching "x64\Debug\launcher.tlog\launcher.lastbuildstate". 2>Done Building Project "c:\Users\mmh\WSL-DistroLauncher\DistroLauncher\DistroLauncher.vcxproj" (default targets). 1>Project "c:\Users\mmh\WSL-DistroLauncher\DistroLauncher.sln" (1) is building "c:\Users\mmh\WSL-DistroLauncher\Di stroLauncher-Appx\DistroLauncher-Appx.vcxproj.metaproj" (3) on node 1 (default targets). 3>Project "c:\Users\mmh\WSL-DistroLauncher\DistroLauncher-Appx\DistroLauncher-Appx.vcxproj.metaproj" (3) is buildi ng "c:\Users\mmh\WSL-DistroLauncher\DistroLauncher-Appx\DistroLauncher-Appx.vcxproj" (4) on node 1 (default targ ets). 4>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets( 436,5): error MSB8020: The build tools for Visual Studio 2017 (Platform Toolset = 'v141') cannot be found. To bu ild using the v141 build tools, please install Visual Studio 2017 build tools. Alternatively, you may upgrade t o the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [c:\Users\mmh\WSL-DistroLauncher\DistroLauncher-Appx\DistroLauncher-Appx.vcxproj] 4>Done Building Project "c:\Users\mmh\WSL-DistroLauncher\DistroLauncher-Appx\DistroLauncher-Appx.vcxproj" (default targets) -- FAILED. 3>Done Building Project "c:\Users\mmh\WSL-DistroLauncher\DistroLauncher-Appx\DistroLauncher-Appx.vcxproj.metaproj" (default targets) -- FAILED. 1>Done Building Project "c:\Users\mmh\WSL-DistroLauncher\DistroLauncher.sln" (Build target(s)) -- FAILED.

Build FAILED.

   "c:\Users\mmh\WSL-DistroLauncher\DistroLauncher.sln" (Build target) (1) ->
   "c:\Users\mmh\WSL-DistroLauncher\DistroLauncher\DistroLauncher.vcxproj" (default target) (2) ->
   (CustomBuild target) ->
     C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targe
   ts(242,5): warning MSB8065: Custom build for item "messages.mc" succeeded, but specified output "c:\users\mmh\ws
   l-distrolauncher\distrolauncher\msg0409.bin" has not been created. This may cause incremental build to work inco
   rrectly. [c:\Users\mmh\WSL-DistroLauncher\DistroLauncher\DistroLauncher.vcxproj]

   "c:\Users\mmh\WSL-DistroLauncher\DistroLauncher.sln" (Build target) (1) ->
   "c:\Users\mmh\WSL-DistroLauncher\DistroLauncher-Appx\DistroLauncher-Appx.vcxproj.metaproj" (default target) (3)
   ->
   "c:\Users\mmh\WSL-DistroLauncher\DistroLauncher-Appx\DistroLauncher-Appx.vcxproj" (default target) (4) ->
   (PrepareForBuild target) ->
     C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.target
   s(436,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 selectin
   g "Retarget solution". [c:\Users\mmh\WSL-DistroLauncher\DistroLauncher-Appx\DistroLauncher-Appx.vcxproj]

1 Warning(s)
1 Error(s)

Time Elapsed 00:00:04.68

mousumih commented 2 years ago

Worked after adding Universal Windows Platform Development Modules from Visual Studio Installer