# C and CXX Compiler Unknown

**URL:** https://discourse.cmake.org/t/c-and-cxx-compiler-unknown/9388
**Category:** Usage
**Created:** [November 8, 2023, 12:09pm UTC](https://discourse.cmake.org/t/c-and-cxx-compiler-unknown/9388 "2023-11-08T12:09:44Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![AlamoGrito](https://discourse.cmake.org/user_avatar/discourse.cmake.org/alamogrito/32/3995_2.png) [@AlamoGrito](https://discourse.cmake.org/u/AlamoGrito)
#### Post date: [November 8, 2023, 12:09pm UTC](https://discourse.cmake.org/t/c-and-cxx-compiler-unknown/9388/1 "2023-11-08T12:09:44Z")

</div>

My general MO for setting up a new machine is to install git for windows, visual studio, python for windows, and then Cmake. Following this sequence I’ve never had a problem to get my build chain using CMake to work without issue. I’m setting up a VM for build purposes and I unintentionally installed CMake before visual studio. It, of course, couldn’t find the compilers so I promptly installed the compilers and it still didn’t work. I uninstalled everything and this time installed Visual Studio first followed by CMake 3.27.7. Oh! I’ve already confirmed that I can build and compile a C++ project with Visual Studio (ran into that problem on previous occasions and confirmed that first). I used the —trace-expand and it turns out that for some reason I need to run my command line environment (Git Bash) as an administrator for it to work. Any ideas why this is happening? Again, I’ve never had this problem before. I’ll dump the first relevant error from --trace-expand here in reply. Thanks.

---

<div class="post-metadata">

### Author: ![AlamoGrito](https://discourse.cmake.org/user_avatar/discourse.cmake.org/alamogrito/32/3995_2.png) [@AlamoGrito](https://discourse.cmake.org/u/AlamoGrito)
#### Post date: [November 8, 2023, 12:12pm UTC](https://discourse.cmake.org/t/c-and-cxx-compiler-unknown/9388/2 "2023-11-08T12:12:57Z")

</div>

Here is relevant output from --trace-expand

C:/Program Files/CMake/share/cmake-3.27/Modules/CMakeDetermineCompilerId.cmake(538): if(CMAKE\_VS\_MSBUILD\_COMMAND AND NOT lang STREQUAL Fortran )  
C:/Program Files/CMake/share/cmake-3.27/Modules/CMakeDetermineCompilerId.cmake(539): set(command C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/MSBuild/Current/Bin/MSBuild.exe CompilerIdC.vcxproj /p:Configuration=Debug /p:Platform=x64 /p:VisualStudioVersion=16.0 )  
C:/Program Files/CMake/share/cmake-3.27/Modules/CMakeDetermineCompilerId.cmake(547): if(command )  
C:/Program Files/CMake/share/cmake-3.27/Modules/CMakeDetermineCompilerId.cmake(548): execute\_process(COMMAND C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/MSBuild/Current/Bin/MSBuild.exe;CompilerIdC.vcxproj;/p:Configuration=Debug;/p:Platform=x64;/p:VisualStudioVersion=16.0 WORKING\_DIRECTORY C:/Users/alamgrito/Documents/repos/libLaTeXUtility/build/CMakeFiles/3.27.7/CompilerIdC OUTPUT\_VARIABLE CMAKE\_C\_COMPILER\_ID\_OUTPUT ERROR\_VARIABLE CMAKE\_C\_COMPILER\_ID\_OUTPUT RESULT\_VARIABLE CMAKE\_C\_COMPILER\_ID\_RESULT )  
C:/Program Files/CMake/share/cmake-3.27/Modules/CMakeDetermineCompilerId.cmake(560): if(Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET Framework  
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 11/8/2023 6:07:58 AM.  
Project “C:\Users\alamogrito\Documents\repos\libLaTeXUtility\build\CMakeFiles\3.27.7\CompilerIdC\CompilerIdC.vcxproj” on node 1 (default targets).  
PrepareForBuild:  
Creating directory “Debug".  
Creating directory “Debug\CompilerIdC.tlog".  
InitializeBuildStatus:  
Creating “Debug\CompilerIdC.tlog\unsuccessfulbuild” because “AlwaysCreate” was specified.  
ClCompile:  
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\CL.exe /c /nologo /W0 /WX- /diagnostics:column /Od /D \_MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar\_t /Zc:forScope /Zc:inline /Fo"Debug\” /Fd"Debug\vc142.pdb” /external:W0 /Gd /TC /FC /errorReport:queue CMakeCCompilerId.c  
TRACKER : error TRK0002: Failed to execute command: ““C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\CL.exe” @C:\Users\alamogrito\AppData\Local\Temp\3\tmp75b40ac18dff457191ff7610d7483791.rsp”. The requested operation requires elevation. [C:\Users\alamogrito\Documents\repos\libLaTeXUtility\build\CMakeFiles\3.27.7\CompilerIdC\CompilerIdC.vcxproj]  
Done Building Project “C:\Users\alamogrito\Documents\repos\libLaTeXUtility\build\CMakeFiles\3.27.7\CompilerIdC\CompilerIdC.vcxproj” (default targets) – FAILED.

Build FAILED.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [November 17, 2023, 1:47pm UTC](https://discourse.cmake.org/t/c-and-cxx-compiler-unknown/9388/3 "2023-11-17T13:47:59Z")

</div>

I’m not sure what requires higher privileges; maybe Git Bash did some security work and dropped privileges in a new version? Without knowing the operation in question, it’s hard to say what might be the root cause here.
