CL.EXE无法编译简单的测试程序VS2017
cl.exe is not able to compile a simple test program VS2017
我正在尝试使用cmake在VS2017上编译我的C 项目(我正在使用Windows 10 x64)。这是我的tasks.json
:
{
"version": "2.0.0",
"tasks": [
{
"label": "CMake Debug",
"type": "shell",
"options": {
"cwd": "${workspaceRoot}/build"
},
"command": "CMake",
"args": [
"-G",
"NMake Makefiles",
"-DCMAKE_BUILD_TYPE=Debug",
".."
],
"problemMatcher": [
"$gcc"
]
},
{
"label": "Make",
"type": "shell",
"options": {
"cwd": "${workspaceRoot}/build"
},
"command": "nmake",
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
,当我运行CMAKE调试任务时,我会收到以下错误:
Executing task: CMake -G 'NMake Makefiles' -DCMAKE_BUILD_TYPE=Debug .. <
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x86/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x86/cl.exe -- broken
CMake Error at C:/Program Files/CMake/share/cmake-3.12/Modules/CMakeTestCCompiler.cmake:52 (message):
The C compiler
"C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x86/cl.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/Paul/Desktop/EIP/Cryptagora-prisma/monitoring_tool/build/CMakeFiles/CMakeTmp
Run Build Command:"nmake" "/nologo" "cmTC_8304cfast"
"C:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.16.27023binHostX64x64nmake.exe" -f CMakeFilescmTC_8304c.dirbuild.make /nologo -L CMakeFilescmTC_8304c.dirbuild
Building C object CMakeFiles/cmTC_8304c.dir/testCCompiler.c.obj
C:PROGRA~2MICROS~22017COMMUN~1VCToolsMSVC1416~1.270binHostx64x86cl.exe -o CMakeFilescmTC_8304c.dirtestCCompiler.c.obj -c C:UsersPaulDesktopEIPCryptagora-prismamonitoring_toolbuildCMakeFilesCMakeTmptestCCompiler.c
NMAKE : fatal error U1045: Úchec de la gÚnÚration dynamiqueá: Invalid argument
Stop.
NMAKE : fatal error U1077: '"C:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.16.27023binHostX64x64nmake.exe"'á: code retour '0x2'
Stop.
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:3 (project)
-- Configuring incomplete, errors occurred!
See also "C:/Users/Paul/Desktop/EIP/Cryptagora-prisma/monitoring_tool/build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/Paul/Desktop/EIP/Cryptagora-prisma/monitoring_tool/build/CMakeFiles/CMakeError.log".
The terminal process terminated with exit code: 1
昨天这很好。
我几个月前就遇到了这个问题,不得不恢复到较旧版本的cmake。专门降级到3.12.4。
相关文章:
- 如何将参数传递给Google基准测试程序
- Cmake无法在qt-creater/collect2上编译简单的测试程序:错误:ld
- CMake 和 Visual Studio 2015 - C 编译器 cl.exe 无法编译简单的测试程序
- C++编译器 g++.exe 无法编译简单的测试程序 - 确定 CXX 编译器是否工作失败
- 如何编译和运行 vmmlib 测试程序?
- C++测试程序中的非法系统调用(对角矩阵元素程序的总和)
- 在我的测试程序中,为什么 cv::resize 不能执行,而 cvtColor 可以?
- 使用 QtCreator 构建 CUDA/C++ 测试程序时出现错误 2
- SDL 测试程序 - "No such file or directory"
- 软件定义无线电 USRP X310 的测试程序
- CMake 在尝试编译简单测试程序时失败
- 无法运行简单的 std::async 和 std::future 测试程序。错误:"has initializer but incomplete type."发生了什么?
- C 编译器无法编译简单的测试程序
- 从测试程序访问共享库中具有静态私有字段的类
- CL.EXE无法编译简单的测试程序VS2017
- 由于某种原因,FSTREAM测试程序崩溃
- Windows CMake 不会编译测试程序
- 为什么在我的测试程序中,从字符缓冲区读取一个int时,"std::copy"5x(!)比"
- 在Windows 7(Mingw,Code :: Blocks)下进行编译,以获取Botan Library测试程序
- 在本地机器上进行应力测试C++程序