CMAKE: he CMAKE_C_COMPILER is set to a C++ compiler

580 views
Skip to first unread message

Mirko Borich

unread,
Jan 24, 2022, 5:05:23 AM1/24/22
to grpc.io
Dearas,  I cannot build grpc and protocol buffers, something is wrong with cmake I installed locally. Any idea?


~/mygrpc/grpc/cmake/build$ cmake ../..
-- The C compiler identification is unknown
-- The CXX compiler identification is GNU 7.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc - broken
CMake Error at /home/build/share/cmake-3.19/Modules/CMakeTestCCompiler.cmake:66 (message):
  The C compiler

    "/usr/bin/gcc"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /home/build/mygrpc/grpc/cmake/build/CMakeFiles/CMakeTmp
   
    Run Build Command(s):/usr/bin/make cmTC_fe086/fast && /usr/bin/make  -f CMakeFiles/cmTC_fe086.dir/build.make CMakeFiles/cmTC_fe086.dir/build
    make[1]: Entering directory '/home/build/mygrpc/grpc/cmake/build/CMakeFiles/CMakeTmp'
    Building C object CMakeFiles/cmTC_fe086.dir/testCCompiler.c.o
    /usr/bin/gcc    -o CMakeFiles/cmTC_fe086.dir/testCCompiler.c.o -c /home/build/mygrpc/grpc/cmake/build/CMakeFiles/CMakeTmp/testCCompiler.c
    /home/build/mygrpc/grpc/cmake/build/CMakeFiles/CMakeTmp/testCCompiler.c:2:3: error: #error "The CMAKE_C_COMPILER is set to a C++ compiler"
     # error "The CMAKE_C_COMPILER is set to a C++ compiler"
       ^~~~~
    make[1]: *** [CMakeFiles/cmTC_fe086.dir/build.make:85: CMakeFiles/cmTC_fe086.dir/testCCompiler.c.o] Error 1
    make[1]: Leaving directory '/home/build/mygrpc/grpc/cmake/build/CMakeFiles/CMakeTmp'
    make: *** [Makefile:140: cmTC_fe086/fast] Error 2
   
   

 

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:38 (project)


-- Configuring incomplete, errors occurred!
See also "/home/build/mygrpc/grpc/cmake/build/CMakeFiles/CMakeOutput.log".
See also "/home/build/mygrpc/grpc/cmake/build/CMakeFiles/CMakeError.log".
Reply all
Reply to author
Forward
0 new messages