简略描述:
验证nuttx安装完整性
第一步:arm-none-eabi-gcc --version
第二步:sudo apt install gcc-arm-none-eabi
再次编译问题解决
详细描述
笔者用官方ubuntu.sh配置好编译环境后,初次用“make px4_fmu-v2_default”命令编译1.10.1stb版本的PX4固件时遇到如下问题:
arm-none-eabi-g++ 路径不完整,找不到
Tell CMake where to find the compiler by setting either the environment variable "CXX"
or the CMake cache entry CMAKE_CXX_COMPILER to the full path to the compiler,
or to the compiler name if it is in the PATH.
说明我们在首次编译前没有验证nuttx的安装完整性,你可以通过确认gcc的版本来验证Nuttx的安装,如果安装不完整,系统会提醒我们该装什么来修复:
输入:arm-none-eabi-gcc --version
输出:Command 'arm-none-eabi-gcc' not found, but can be installed with:
sudo apt install gcc-arm-none-eabi
系统告诉我们需要安装gcc-arm-none-eabi,因此:
输入:sudo apt install gcc-arm-none-eabi
输出:...
正在设置 libstdc++-arm-none-eabi-newlib (15:6.3.1+svn253039-1+10) ...
正在设置 gcc-arm-none-eabi (15:6.3.1+svn253039-1build1) ...
正在处理用于 man-db (2.8.3-2ubuntu0.1) 的触发器 ...
正在处理用于 ccache (3.4.1-1) 的触发器 ...
Updating symlinks in /usr/lib/ccache ...
正在处理用于 libc-bin (2.27-3ubuntu1) 的触发器 ...
我们再来验证一次nuttx的安装完整性:
输入:arm-none-eabi-gcc --version
输出:arm-none-eabi-gcc (15:6.3.1+svn253039-1build1) 6.3.1 20170620
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
说明nuttx已经完整安装,接着我们再次编译测试:
输入:make px4_fmu-v2_default
输出:[0/7] Performing build step for 'px4io_firmware'
ninja: no work to do.
[7/7] Creating /home/heng/桌面/v1.10..._fmu-v2_default/px4_fmu-v2_default.px4
编译通过,问题解决