cl.exe не может скомпилировать простую тестовую программу VS2017 - PullRequest
0 голосов
/ 19 февраля 2019

Я пытаюсь скомпилировать мой c ++ проект на VS2017 с CMake (я использую 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 Debug, я получаю следующую ошибку:

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_8304c\fast"
        "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\nmake.exe" -f CMakeFiles\cmTC_8304c.dir\build.make /nologo -L                  CMakeFiles\cmTC_8304c.dir\build
    Building C object CMakeFiles/cmTC_8304c.dir/testCCompiler.c.obj
        C:\PROGRA~2\MICROS~2\2017\COMMUN~1\VC\Tools\MSVC\1416~1.270\bin\Hostx64\x86\cl.exe    -o CMakeFiles\cmTC_8304c.dir\testCCompiler.c.obj   -c C:\Users\Paul\Desktop\EIP\Cryptagora-prisma\monitoring_tool\build\CMakeFiles\CMakeTmp\testCCompiler.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 Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\nmake.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

Это работалоотлично вчера

1 Ответ

0 голосов
/ 19 февраля 2019

У меня была эта проблема несколько месяцев назад, и мне пришлось вернуться к более старой версии cmake.В частности, понижение до 3.12.4.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...