PX4源码分析15:初次编译,No CMAKE_CXX_COMPILER could be found,需要设置环境变量CXX

简略描述:

验证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

编译通过,问题解决

  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值