"waf configure --board=navio2" can't find 'arm-linux-gnueabihf-pkg-config'

Hi,

While following the instructions for building ArduPilot from sources from the navio2 documentation, I encounter the following output when exectuing the command “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' : /usr/bin/arm-linux-gnueabihf-ar 
Using toolchain                               : arm-linux-gnueabihf 
Checking for 'g++' (C++ compiler)             : /usr/bin/arm-linux-gnueabihf-g++ 
Checking for 'gcc' (C compiler)               : /usr/bin/arm-linux-gnueabihf-gcc 
Checking for program 'arm-linux-gnueabihf-pkg-config' : not found
Could not find the program ['arm-linux-gnueabihf-pkg-config']
(complete log in /home/pi/ardupilot/build/config.log)

Could not find the program [‘arm-linux-gnueabihf-pkg-config’]
(complete log in /home/pi/ardupilot/build/config.log)

I have read online and found a few similar posts where people were trying to compile the ardupilot, but then encountered a similar problem: link

I tried to install the missing program by running “sudo apt-get install pkg-config-arm-linux-gnueabihf” as suggested in the post. This did not solve my problem.

Does anyone of you know how to solve this?

1 Like

I had the same problem. If I remember well I just copied /usr/bin/pkg-config (or maybe arm-unknown-linux-gnueabihf-pkg-config?)as /usr/bin/arm-linux-gnueabihf-pkg-config and it worked:

# cp /usr/bin/arm-unknown-linux-gnueabihf-pkg-config /usr/bin/arm-linux-gnueabihf-pkg-config
# waf…

You have to download the cross compiler of raspberry pi foundation as given in this and get a files in opt/tools https://docs.emlid.com/navio2/Navio-APM/building-from-sources/#cross-compiler-setup-on-linux-optional and also don’t forget to set the variable PATH. and then do the building. The files that it is looking for is in in the opt/tools