Share via

error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.33.31629\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2

xieyapei 101 Reputation points
2022-10-10T07:25:37.857+00:00

Hi,

I have installed Microsoft C++ Build Tools 2022 to help me compile C files created by Cython. When I install DCNv2, it gives me this error:

error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.33.31629\bin\HostX86\x64\cl.exe' failed with exit code 2

Please help as I am not well-rounded with Visual Studio and just need to get my code running.

Thanks

Developer technologies | C++
Developer technologies | C++

A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.


6 answers

Sort by: Most helpful
  1. k_cire 15 Reputation points
    2023-01-18T16:20:21.6633333+00:00

    Hi,

    I having the same issue.

     The C compiler
    
        "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe"
    
      is not able to compile a simple test program.
    
      It fails with the following output:
    
        Change Dir: C:/Users/320216482/source/repos/CMakeProject1/out/build/x64-debug/CMakeFiles/CMakeTmp
        
        Run Build Command(s):C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe cmTC_1acb3 && [1/2] Building C object CMakeFiles\cmTC_1acb3.dir\testCCompiler.c.obj
        [2/2] Linking C executable cmTC_1acb3.exe
        FAILED: cmTC_1acb3.exe 
        cmd.exe /C "cd . && "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\cmTC_1acb3.dir --rc=rc --mt=CMAKE_MT-NOTFOUND --manifests  -- C:\PROGRA~1\MIB055~1\2022\COMMUN~1\VC\Tools\MSVC\1434~1.319\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_1acb3.dir\testCCompiler.c.obj  /out:cmTC_1acb3.exe /implib:cmTC_1acb3.lib /pdb:cmTC_1acb3.pdb /version:0.0 /machine:x64  /debug /INCREMENTAL /subsystem:console  kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
        RC Pass 1: command "rc /fo CMakeFiles\cmTC_1acb3.dir/manifest.res CMakeFiles\cmTC_1acb3.dir/manifest.rc" failed (exit code 0) with the following output:
        Le fichier spécifié est introuvable
        ninja: build stopped: subcommand failed.
    

    Please someone did you find a solution?

    Was this answer helpful?

    2 people found this answer helpful.

  2. Lan Nguyen 11 Reputation points
    2022-10-26T19:06:12.21+00:00

    Hi,
    I am seeing the same error as well, I tried to add this C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.33.31629\bin\HostX86\x64\cl.exe' in PATH to hopefully resolve the issue but it doesn't seem to work. I am not sure whether this issue coming from installing the wrong workload or not. Really hope to tap into the expert group here to resolve this.
    Thank you so much.

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments

  3. Ana Maria Risnoveanu 10 Reputation points
    2023-09-20T07:25:41.87+00:00

    The issue was fixed after I installed the latest version, pycocotools 2.0.7 .The problem was with a specific release, 2.0.4.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

  4. Ana Maria Risnoveanu 10 Reputation points
    2023-09-19T11:23:08.6666667+00:00

    I am having the same issue :

    "error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.37.32822\bin\HostX86\x64\cl.exe' failed with exit code 2"

    I have already reinstalled Python 3.8.10 after downloading the Desktop Development with C++. I currently have the latest Visual Studio Installer 17.7.4.

    Was this answer helpful?

    1 person found this answer helpful.

  5. Stephen chellingsworth 0 Reputation points
    2023-04-04T01:35:49.8+00:00

    Classified

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.