Maybe simple...
sudo apt-get install gcc
... could be enough?
Answer from Jot eN on askubuntu.comMaybe simple...
sudo apt-get install gcc
... could be enough?
Do this: open a terminal and type gcc --version. Does anything come up?
Alternatively, search for the gcc executable, which should be located in /usr/bin.
Do ls /usr/bin | grep gcc. What output do you get from that command?
If you get no output from either command, then you need to find your gcc executable wherever you installed it (somewhere in /usr/share maybe?). When found, do cd /usr/bin && ln -s [ABSOLUTE PATH OF GCC].
If you got no output from the first, but output from the second, then you have serious trouble, because /usr/bin is not in your PATH. Edit the file /etc/environment and ADD the following line to the end of the document: PATH="$PATH:/usr/bin".
If you got output from the first, then there is a problem somewhere with bash not reading its own PATH. I think hell would freeze before the first works, but watch you prove me wrong and freeze hell for me. :)
Hope this helps! +1 me if it does!
Most probably you did not add the correct path to the tool chain properly.
export PATH=$(pwd)/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin:$PATH
put this in your AOSP(the folder where you have your android platform in).
because the default gcc/g++ are configured as arm-eabi-gcc by accident perhaps with the command update-alternatives. to fix require to revert back alternatives to the original:
sudo update-alternatives --remove-all gcc
sudo update-alternatives --remove-all g++
next, configure default gcc/g++ for the default host toolchain:
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 60
only then make default arm-eabi-gcc/arm-eabi-g++ available:
sudo update-alternatives --install /usr/bin/arm-eabi-gcc arm-eabi-gcc /home/oc2/prebuilt/linux-86X/toolchain/arm-eabi-4.4.0/bin/arm-eabi-gcc 60
sudo update-alternatives --install /usr/bin/arm-eabi-g++ arm-eabi-g++ /home/oc2/prebuilt/linux-86X/toolchain/arm-eabi-4.4.0/bin/arm-eabi-g++ 60
/bin/sh: 1: arm-linux-gcc: not found on ubuntu - Stack Overflow
How do I fix gcc not found error when cross compiling the linux kernel for beaglebone black - Stack Overflow
/bin/sh: 1: aarch64-linux-android-gcc: not found
gnu make - Why is there such error of "arm-linux-gcc: not found"? - Unix & Linux Stack Exchange
It looks like you need to install g++. This is available via dnf:
dnf install gcc-c++
In the future, if you see any variant of a command not found error, you can search for the package that provides the "command" with
dnf whatprovides \*/bin/<command>
It used to be that you could just say whatprovides <command> but Fedora now wants the full path to the binary that you're looking for. Since we don't know it, we use prepend \*/bin to look in all bin directories.
Note that dnf is a replacement for yum and became the default package manager in Fedora 22. If you're on an early version of Fedora, you can replace dnf with yum in any of the previous commands and you'll get the same results.
The C++ compiler, g++, is either not installed or not available via the PATH environment variable.
Try installing the C++ compiler.
I'm also getting the same for cc and pkg-config. I was trying to compile a kernel and install something from AUR. Searching around didn't give me any answers that I felt comfortable following as I couldn't establish that the contexts in which the issues occurred were similar enough. Any help appreciated.`
/proc/version isn't saying that gcc is present, it's just giving the version of gcc that was used to build the kernel (on a build system somewhere).
The gcc version displayed by /proc/version is the one used to compile your kernel, not the one installed on your system. Use apt install gcc to actually install it.
