编译PX4时出现下面错误怎么办error: non-constant condition for static assertion

在Ubuntu16.04版本下,编译PX4时,总是出现下面的情况,不知道是什么原因,有哪位大神帮忙解答吗?

u@ubuntu:~/src/Firmware$ make px4_fmu-v2_default
-- PX4 config file: /home/hanlu/src/Firmware/boards/px4/fmu-v2/default.cmake
-- PX4 config: px4_fmu-v2_default
-- PX4 platform: nuttx
-- PX4 lockstep: disabled
-- PX4 version: v1.9.0-216-gbef7a9b
-- cmake build type: MinSizeRel
-- The CXX compiler identification is GNU 4.9.3
-- The C compiler identification is GNU 4.9.3
-- The ASM compiler identification is GNU
-- Found assembler: /opt/gcc-arm-none-eabi-4_9-2015q3/bin/arm-none-eabi-gcc
-- Check for working CXX compiler using: Ninja
-- Check for working CXX compiler using: Ninja -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working C compiler using: Ninja
-- Check for working C compiler using: Ninja -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Found PythonInterp: /usr/bin/python (found version "2.7.12")
-- Found PY_jinja2: /usr/local/lib/python2.7/dist-packages/Jinja2-2.7.3-py2.7.egg/jinja2

-- PX4 ECL: Very lightweight Estimation & Control Library v1.9.0-rc1-5-g54ac147
-- Building and including px4_io-v2_default
-- ROMFS: px4fmu_common
-- ROMFS: Adding rc.board_defaults
-- ROMFS: Adding rc.board_sensors
-- Configuring done
-- Generating done
-- Build files have been written to: /home/hanlu/src/Firmware/build/px4_fmu-v2_default
[1/690] git submodule platforms/nuttx/NuttX/nuttx
[4/690] git submodule platforms/nuttx/NuttX/apps
[5/690] git submodule src/lib/ecl
[10/690] git submodule src/drivers/gps/devices
[16/690] git submodule mavlink/include/mavlink/v2.0
[24/690] Performing configure step for 'px4io_firmware'
-- PX4 config file: /home/hanlu/src/Firmware/boards/px4/io-v2/default.cmake
-- PX4 config: px4_io-v2_default
-- PX4 platform: nuttx
-- PX4 lockstep: disabled
-- PX4 version: v1.9.0-216-gbef7a9b
-- cmake build type: MinSizeRel
-- The CXX compiler identification is GNU 4.9.3
-- The C compiler identification is GNU 4.9.3
-- The ASM compiler identification is GNU
-- Found assembler: /opt/gcc-arm-none-eabi-4_9-2015q3/bin/arm-none-eabi-gcc
-- Check for working CXX compiler using: Ninja
-- Check for working CXX compiler using: Ninja -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working C compiler using: Ninja
-- Check for working C compiler using: Ninja -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Found PythonInterp: /usr/bin/python (found version "2.7.12")
-- Found PY_jinja2: /usr/local/lib/python2.7/dist-packages/Jinja2-2.7.3-py2.7.egg/jinja2

-- PX4 ECL: Very lightweight Estimation & Control Library v1.9.0-rc1-5-g54ac147
-- Configuring done
-- Generating done
-- Build files have been written to: /home/hanlu/src/Firmware/build/px4_fmu-v2_default/external/Build/px4io_firmware
[25/690] Performing build step for 'px4io_firmware'
[1/200] git submodule platforms/nuttx/NuttX/nuttx
[5/200] git submodule platforms/nuttx/NuttX/apps
[39/200] Building CXX object src/platforms/common/CMakeFiles/px4_platform.dir/module.cpp.obj
FAILED: /opt/gcc-arm-none-eabi-4_9-2015q3/bin/arm-none-eabi-g++ -DCONFIG_ARCH_BOARD_PX4_IO_V2 -D__CUSTOM_FILE_IO__ -D__DF_NUTTX -D__PX4_NUTTX -D__STDC_FORMAT_MACROS -isystem ../../../../../platforms/nuttx/NuttX/include/cxx -isystem NuttX/nuttx/include/cxx -isystem NuttX/nuttx/include -I../../../../../boards/px4/io-v2/src -I. -Isrc -Isrc/lib -Isrc/modules -I../../../../../src -I../../../../../src/include -I../../../../../src/lib -I../../../../../src/lib/DriverFramework/framework/include -I../../../../../src/lib/matrix -I../../../../../src/modules -I../../../../../src/platforms -I../../../../../src/platforms/common -INuttX/nuttx/arch/arm/src/armv7-m -INuttX/nuttx/arch/arm/src/chip -INuttX/nuttx/arch/arm/src/common -INuttX/apps/include -Iexternal/Install/include -mcpu=cortex-m3 -mthumb -Os -DNDEBUG -g -fdata-sections -ffunction-sections -fomit-frame-pointer -fno-signed-zeros -fno-trapping-math -freciprocal-math -fno-math-errno -fno-strict-aliasing -fvisibility=hidden -include visibility.h -Wall -Wextra -Werror -Warray-bounds -Wcast-align -Wdisabled-optimization -Wdouble-promotion -Wfatal-errors -Wfloat-equal -Wformat-security -Winit-self -Wlogical-op -Wpointer-arith -Wshadow -Wuninitialized -Wunknown-pragmas -Wunused-variable -Wno-implicit-fallthrough -Wno-missing-field-initializers -Wno-missing-include-dirs -Wno-unused-parameter -fdiagnostics-color=always -fno-builtin-printf -fno-strength-reduce -Wformat=1 -Wunused-but-set-variable -Wno-format-truncation -fcheck-new -fno-exceptions -fno-rtti -fno-threadsafe-statics -Wreorder -Wno-overloaded-virtual -D__STDC_VERSION__=199901L -nostdinc++ -std=gnu++11 -MMD -MT src/platforms/common/CMakeFiles/px4_platform.dir/module.cpp.obj -MF src/platforms/common/CMakeFiles/px4_platform.dir/module.cpp.obj.d -o src/platforms/common/CMakeFiles/px4_platform.dir/module.cpp.obj -c ../../../../../src/platforms/common/module.cpp
In file included from ../../../../../src/platforms/px4_module.h:44:0,
from ../../../../../src/platforms/common/module.cpp:43:
../../../../../src/platforms/px4_atomic.h: In instantiation of 'class px4::atomic':
../../../../../src/platforms/px4_module.h:421:42: required from here
../../../../../src/platforms/px4_atomic.h:72:2: error: non-constant condition for static assertion
static_assert(__atomic_always_lock_free(sizeof(T), 0), "atomic is not lock-free for the given type T");
^
compilation terminated due to -Wfatal-errors.
[39/200] Building CXX object msg/CMakeFiles/uorb_msgs.dir/topics_sources/gps_inject_data.cpp.obj
ninja: build stopped: subcommand failed.
[108/690] Building CXX object msg/CMakeFiles/uorb_msgs.dir/topics_sources/rc_parameter_map.cpp.obj
FAILED: cd /home/hanlu/src/Firmware/build/px4_fmu-v2_default/external/Build/px4io_firmware && /usr/bin/cmake --build . && /usr/bin/cmake -E touch /home/hanlu/src/Firmware/build/px4_fmu-v2_default/external/Stamp/px4io_firmware/px4io_firmware-build
[108/690] Building CXX object msg/CMakeFiles/uorb_msgs.dir/topics_sources/rc_parameter_map.cpp.obj
ninja: build stopped: subcommand failed.
Makefile:193: recipe for target 'px4_fmu-v2_default' failed
make: *** [px4_fmu-v2_default] Error 1

1个回答

应该是gcc版本过低,建议去百度一下gcc版本查询指令,然后升级到gcc7以上版本。

qq_44545210
染上、谁的颜色 回复冰心的小朋友: https://blog.csdn.net/a253195515/article/details/77773512 我是用了第二种自动安装的方法。
5 个月之前 回复
sparkle_girl
冰心的小朋友 你最后是怎么解决的?我也是这个问题。
6 个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问

相似问题

1
make编译报错:fatal error: gnu/stubs-64.h:
2
matlab 编译提示NMAKE : fatal error U1073: don't know how to make 'C:\Program' Stop.?
1
在Autoware 中编译yolo3节点时,发生darknet: ./src/cuda.c:36: check_error: Assertio `0' failed.
2
keil5打开keil4工程后编译出现问题怎么办?
2
zabbix server 安装完成进入页面php报错,A non-numeric value encountered……?
1
android studio 编译myclass报错?
3
编译错误:variable-sized object may not be initialized
1
使用ubuntu编译 ffmpeg 时报错:ERROR: x265 not found using pkg-config
1
ubuntu 平台 codeblocks 编译多文件项目时出现error: ld returned 1 exit status 的问题
2
qt在编译c++11 的<"thread">头文件时报错
0
在VS2.17配置PCL1.9.0,出现 LINK : fatal error LNK1181: 无法打开输入文件“cmake.obj”
0
VS2015下stlport编译时error:无法打开包括文件"../include/ctype.h"?
0
php-5.3.6 交叉编译 发生错误configure: error: ZLIB extension requires zlib >= 1.0.9
1
请问Spring配置文件<tx:annotation-driven transaction-manager="txManager" />编译不过去怎么解决
1
PX4编译问题,编译出错
2
idea 写flutter app,重启电脑后项目便宜报错Error:Android Dex: [my_app] Unable to execute DX
2
error: reference to 's' is ambiguous
2
配置Linux编译环境时出现arm-linux-gnueabihf-gcc: fatal error: no input files问题
1
QT5出现error: /bigobj: No such file or directory这样怎么处理
1
Ubuntu编译内核时make menuconfig出错的问题