Cannot find appropriate C compiler on this system

i got this error when using ./bootstrap command for installing cmake

---------------------------------------------
CMake 3.18.0, Copyright 2000-2020 Kitware, Inc. and Contributors
---------------------------------------------
Error when bootstrapping CMake:
Cannot find appropriate C compiler on this system.
Please specify one using environment variable CC.
See cmake_bootstrap.log for compilers attempted.

i checked for gcc and got

gcc --version
bash: /usr/bin/gcc: No such file or directory
whereis gcc
gcc: /usr/lib/gcc /usr/share/man/man1/gcc.1.gz

i checked cmake_bootstrap.log file and got

./bootstrap: 803: ./bootstrap: /usr/local/bin/gcc-7: not found
Test failed to compile
1

2 Answers

It looks like you don't have gcc installed.

In case you specifically need gcc-7, you can install it with

sudo apt install gcc-7

Otherwise you can install the package gcc or build-essential(which would provide a later version of gcc).

In case this program bootstrap wants to have gcc-7 at the specific location /usr/local/bin/ and that cannot be changed, you can symlink it.

sudo ln -s /usr/bin/gcc-7 /usr/local/bin/gcc-7
1

By default, new installation of Ubuntu does not have C compiler installed (nor any other tools needed for compiling programs). To install it, you need to install build-essential package:

sudo apt-get install build-essential
0

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like