我们有一个基于 docker pull mcr.microsoft.com/dotnet/framework/sdk:4.8
docker文件的一部分用于容器的其他工作负载,
vs_buildtools.exe --quiet --wait --norestart --nocache modify \
--installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools" \
--add Microsoft.VisualStudio.Workload.VCTools \
--add Microsoft.VisualStudio.Workload.DataBuildTools \
--add Microsoft.VisualStudio.Workload.UniversalBuildTools
但C ++项目的构建失败, 我们有一个基于 docker pull mcr.microsoft.com/dotnet/framework/sdk:4.8 构建docker文件的一部分说他们找不到cl.exe。
我已经搜索过这个问题,每个有错误的人都说找不到Cl.exe获得了仅运行 vsvars.bats.bat
的答案,并为他们修复了它。但是cl.exe 实际上不存在 。我们转到C:\ Program Files(X86)\ Microsoft Visual Studio \ 2022 \ buildTools \ VC \ tools \ MSVC \ 14.31.31103,没有bin文件夹。
我们在整个容器中搜索了Cl.exe,并在某些C:\ Windows \ winsxs \文件夹中看到了它,我们尝试将其添加到路径环境中,但是它与Windows版本不兼容它的错误。
是否有某种原因无法安装实际的编译器?
We have a Jenkins build agent based on docker pull mcr.microsoft.com/dotnet/framework/sdk:4.8
Part of the Docker file for the container pulls in additional workloads as follows
vs_buildtools.exe --quiet --wait --norestart --nocache modify \
--installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools" \
--add Microsoft.VisualStudio.Workload.VCTools \
--add Microsoft.VisualStudio.Workload.DataBuildTools \
--add Microsoft.VisualStudio.Workload.UniversalBuildTools
But builds of C++ projects fail saying they can't find CL.EXE.
I've Googled this problem and everybody who's had errors saying they couldn't find CL.EXE got the answer to just run vsvars.bat
and that fixed it for them. But the CL.exe is physically not there. We go to C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.31.31103 and there is no bin folder.
We searched the whole container for cl.exe and do see it in some c:\windows\WinSxS\ folder, and we tried adding that to the PATH environment, but it got an error about it not being compatible with the version of Windows.
Is there some reason it won't install the actual compiler?
发布评论
评论(1)
您还需要传递
- includeRecommended
或- 添加microsoft.visualstudio.component.vc.tools.x86.x64
作为参数。MSVC V143 -VS 2022 C ++ X64/X86构建工具(最新) 在
vctools Workload包含的组件 推荐
因此,默认情况下,未使用 microsoft.visualstudio.workload.vctools 安装。
这是
的描述 - 添加
参数来自:You also need to pass either
--includeRecommended
or--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64
as an argument.MSVC v143 - VS 2022 C++ x64/x86 build tools (Latest) is listed among
Components included by VCTools workload as Recommended
and thus is not installed with Microsoft.VisualStudio.Workload.VCTools by default.
Here's the description of the
--add
parameter from VS Installer command-line parameter reference: