Building Ardupilot for Navio2 board

Hello,
I am trying to build Ardupilot for Navio2 on Emilid OS by following the steps on https://docs.emlid.com/navio2/Navio-APM/building-from-sources/#where-to-get-the-code
Everything went fine until I had to configure waf for building by issuing "

waf configure --board=navio2"

which resulted in the following:

pi@navio:~/ardupilot $ waf configure --board=navio2
Setting top to : /home/pi/ardupilot
Setting out to : /home/pi/ardupilot/build
Autoconfiguration : enabled
Setting board to : navio2
Checking for program ‘arm-linux-gnueabihf-ar’ : /opt/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-ar
Using toolchain : arm-linux-gnueabihf
Checking for ‘g++’ (C++ compiler) : not found
Checking for ‘clang++’ (C++ compiler) : Execution failure: [’/opt/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc’, ‘–print-sysroot’]
Traceback (most recent call last):
File “”, line 27, in run
File “/usr/lib/python2.7/subprocess.py”, line 710, in init
errread, errwrite)
File “/usr/lib/python2.7/subprocess.py”, line 1335, in _execute_child
raise child_exception
OSError: [Errno 8] Exec format error

I hope I can get some help from anybody.

Thanks in advance

Giuseppe

Hello, Giuseppe!

This questions had been answered before. Please, take a look at the solution. I hope, it’ll be clear.