Reading time: | 15 min |
Last updated: | 16 Dec 2024 |
Test status: |
Reading time: |
15 min |
Last updated: |
16 Dec 2024 |
Test status: |
This guide is intended to get you up and running with this tool quickly with the most common settings. For a thorough review of all options, refer to the official documentation.
GCC is available on all Linux distributions and can be installed using the package manager.
Follow the instructions below to install GCC on an Arm Linux distribution. This covers gcc
and g++
for compiling C and C++ applications.
Confirm you are using an Arm machine by running:
uname -m
The output should be:
aarch64
If you see a different result, you are not using an Arm computer running 64-bit Linux.
The Linux package manager downloads the required files so there are no special instructions.
Use the apt
command to install software packages on any Debian based Linux distribution, including Ubuntu.
sudo apt update
sudo apt install gcc g++ -y
Another meta-package on Ubuntu is build-essential
. This will install the most common tools and libraries with a single command.
sudo apt install build-essential -y
These Linux distributions use dnf
as the package manager.
To install the most common development tools use the commands below. If the machine has sudo
you can use it.
sudo dnf update -y
sudo dnf groupinstall 'Development Tools' -y
If sudo
is not available become root and omit the sudo
.
dnf update -y
dnf groupinstall 'Development Tools' -y
GCC is open source and freely available for use.
To confirm the installation is complete run:
gcc --version
To compile an example program, create a text file named hello-world.c with the contents below.
#include <stdio.h>
int main()
{
printf("Hello, Arm World!\n");
return 0;
}
To compile and run the application use:
gcc -o hello-world hello-world.c
./hello-world
Observe the output:
Hello, Arm World!
How would you rate the overall quality of this tool quick-install guide?
What is the primary reason for your feedback ?
Thank you. We're grateful for your feedback on how to improve this tool quick-install guide.