【发布时间】:2021-12-25 08:13:21
【问题描述】:
我遇到了有关 MSVC 的问题。当我尝试运行开发人员命令提示符并键入cl 时,它给了我这个错误:
Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30137 for x86
Copyright (C) Microsoft Corporation. All rights reserved.
cl : Command line warning D9024 : unrecognized source file type 'C:\Program', object file assumed
cl : Command line warning D9024 : unrecognized source file type 'Files', object file assumed
cl : Command line warning D9024 : unrecognized source file type '(x86)\Microsoft', object file assumed
cl : Command line warning D9024 : unrecognized source file type 'Visual', object file assumed
cl : Command line warning D9024 : unrecognized source file type 'Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx86\x86\cl.exe', object file assumed
Microsoft (R) Incremental Linker Version 14.29.30137.0
Copyright (C) Microsoft Corporation. All rights reserved.
/out:Program.exe
C:\Program
Files
(x86)\Microsoft
Visual
Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx86\x86\cl.exe
LINK : fatal error LNK1104: cannot open file 'Program.exe'
我不确定发生了什么。我尝试重新安装 Visual Studio 并对其进行修复,但仍然无法正常工作。我尝试做一些研究以找到解决方案,但没有找到。
【问题讨论】:
-
"当我尝试运行开发人员命令提示符并键入 cl" 你为什么这样做?你想要完成什么?
cl需要参数,不带参数运行是没有意义的。 -
我只是在安装 vs 后测试 msvc 编译器是否工作
-
我无法在 19.29.30037 上重现此内容。我得到 usage: cl [ option... ] filename... [ /link linkoption... ]
-
@chris 是的,这就是它应该做的
-
如果我实际运行
cl C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx86\x86\cl.exe而不仅仅是cl,我会得到相同的输出。你确定这不是实际运行的吗?
标签: c++ visual-studio visual-studio-2019