如何找到 Visual Studio 正在调用的确切编译器可执行文件?

问题描述 投票:0回答:2

我正在使用带有 C++ 的 Visual Studio。

由于特殊原因,我现在需要使用 CMake 来构建项目的一部分。我想告诉 CMake 使用我通常在 Visual Studio 中使用的相同编译器。

如何找到 Visual Studio 使用的确切

cl.exe
编译器可执行路径?我的机器上有一些。

c++ windows visual-studio
2个回答
3
投票

在 VS 内的菜单“工具”>“命令行”中选择“开发人员命令提示符”,然后运行“where cl”。您还可以选择

Developer PowerShell
并运行 Get-Command cl
gcm cl
或专门运行
(Get-Command cl).Source

您还可以打开开始菜单,输入

developer

并打开所需的终端


0
投票
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\Hostx64\x64

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\Hostx86\x86
(对于 32 位)。
14.26.28801
在您的电脑上会有所不同
    

© www.soinside.com 2019 - 2024. All rights reserved.