CMake Error,The C++ compiler is not able to compile a simple test program. Waiting for your help.

沈家本 0 Reputation points
2024-03-06T18:26:12.0566667+00:00

running build_ext

  -- Building for: Visual Studio 17 2022

  -- The CXX compiler identification is MSVC 19.39.33521.0

  -- Detecting CXX compiler ABI info

  -- Detecting CXX compiler ABI info - failed

  -- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.39.33519/bin/Hostx64/x64/cl.exe

  -- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.39.33519/bin/Hostx64/x64/cl.exe - broken

  CMake Error at C:/Users/40295/AppData/Local/Temp/pip-build-env-4i948kux/overlay/Lib/site-packages/cmake/data/share/cmake-3.28/Modules/CMakeTestCXXCompiler.cmake:60 (message):

    The C++ compiler

      "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.39.33519/bin/Hostx64/x64/cl.exe"

    is not able to compile a simple test program.

    It fails with the following output:

      Change Dir: 'C:/Users/40295/AppData/Local/Temp/pip-install-vje8ab5x/chatglm-cpp_884db90f1abd4fc4ac64346e24a250e6/build/temp.win-amd64-cpython-39/Release/chatglm_cpp._C/CMakeFiles/CMakeScratch/TryCompile-4c6r1y'

      Run Build Command(s): "C:/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/amd64/MSBuild.exe" cmTC_dd2fe.vcxproj /p:Configuration=Debug /p:Platform=x64 /p:VisualStudioVersion=17.0 /v:n

      閫傜敤浜\x8e .NET Framework MSBuild 鐗堟湰 17.9.5+33de0b227

      鐢熸垚鍚\xaf鍔ㄦ椂闂翠负 2024/3/7 2:19:17銆\x82
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,870 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Tianyu Sun-MSFT 29,351 Reputation points Microsoft Vendor
    2024-03-07T08:00:33.4033333+00:00

    Hello @沈家本,

    Welcome to Microsoft Q&A forum.

    Please try following:

    1. Run Visual Studio as administrator and build the project.
    2. Try to use command line tools to compile your project and check if this works. You can search and use "Native Tools Command Prompt for VS 2022" from Windows Search box.

    Besides, is this issue reproducible on a newly created project? If this issue is reproducible, please share us the detailed steps to reproduce it and check further.

    Best Regards,

    Tianyu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.