This guide explains how to set up a cross-compilation development environment for the Raspberry Pi. We'll be using the familiar APT package manager for installing cross-compilation dependencies, so you can just apt-get install any library from the Debian or Raspberry Pi OS repositories.

We use a modern GCC 11 toolchain for C, C++ and Fortran. Configuration files for easy on-target debugging in Visual Studio Code are provided. A hello world CMake project is included as an example.

Everything was tested on Ubuntu 20.04 LTS on the build machine and Raspberry Pi OS Buster on a Raspberry Pi Zero.

If you're targeting a Raspberry Pi running Ubuntu, also see the Ubuntu to Ubuntu Cross C++ Development guide.