# Native compiler

## About this Install Guide

|  |  |
| --- | --- |
| Reading time: | 10 min |
| Last updated: | 10 Nov 2026 |
| Ecosystem dashboard: | [View](https://developer.arm.com/ecosystem-dashboard/linux?package=GNU%20Toolchain%20%28GCC%29) |

This guide shows you how to install and use the tool with the most common configuration. For advanced options and complete reference information, see the official documentation. Some install guides also include optional next steps to help you explore related workflows or integrations.

Install GCC and G++ on your Arm Linux machine to build and run C and C++ applications.

## Confirm you are on Arm Linux

Before installing, verify you’re running on an Arm system:

```bash
uname -m
```

The expected output is:

```bash
__output__ aarch64
```

If you see `x86_64` instead, you need a [cross-compiler](https://learn.arm.com/install-guides/gcc/cross), not a native compiler.

## Install GCC

Install GCC and G++ using the commands for your Linux distribution:

```bash
sudo apt update
sudo apt install build-essential -y
```

```bash
sudo dnf install gcc gcc-c++ -y
```

On Ubuntu and Debian, `build-essential` also installs `make` and other common build tools. On Fedora, RHEL, and Amazon Linux, the `gcc-c++` package provides G++. The GCC version depends on your distribution release.

## Verify the installation

Verify GCC is installed:

```bash
gcc --version
```

The output is similar to:

```bash
__output__ gcc (Ubuntu 15.2.0-16ubuntu1) 15.2.0
__output__ Copyright (C) 2025 Free Software Foundation, Inc.
__output__ This is free software; see the source for copying conditions.  There is NO
__output__ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
```

Verify G++ is also installed:

```bash
g++ --version
```

The output is similar to:

```bash
__output__ g++ (Ubuntu 15.2.0-16ubuntu1) 15.2.0
__output__ Copyright (C) 2025 Free Software Foundation, Inc.
__output__ This is free software; see the source for copying conditions.  There is NO
__output__ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
```

## Compile and run a program

Create a file named `hello.c`:

```c
#include <stdio.h>

int main()
{
    printf("Hello, Arm World!\n");
    return 0;
}
```

Compile `hello.c` with GCC, then run the resulting `hello` executable:

```bash
gcc -o hello hello.c
./hello
```

The expected output is:

```bash
__output__ Hello, Arm World!
```

You can now compile C and C++ applications on your Arm Linux machine.
