Using C++ on Dietpi

disclaimer: I am new to coding and pi-ing, please be detailed in your answers!

I am working on a project and need to use code that is written in c++, but I know to convert it to Python would be fairly painful. I read that I would need to use a GCC compiler to allow dietpi to run c++, but I don’t know how to install that onto the dietpi. How would I go about doing that?

Have a look into dietpi-software and install Build Essential. Usually this should do it. To verify run

gcc --version

The compiler package is:

apt install g++

It pulls in the C++ standard library and development headers, as well as C compiler, standard library and headers, hence shouldn’t leave anything open. The command then is g++ as well.

Installed as well via Build-Essential in dietpi-software indeed, which adds make and automake (+autoconf) as well:

dietpi-software install 16