编译报错 cc1: all warnings being treated as errors

编译报错 ./build.sh
 
报错内容:
arm-none-eabi-size cf2_nrf.elf
text data bss dec hex filename
65440 612 5032 71084 115ac cf2_nrf.elf
S110 Activated
BLE Disabled
Built for platform cf2
CLEAN_VERSION
CC position_controller_indi.o
CC cfassert.o
CC exptest.o
CC cpuid.o
CC exptestRR.o
CC eprintf.o
CC exptestBolt.o
CC filter.o
.//src/modules/src/position_controller_indi.c: In function 'positionControllerINDI':
.//src/modules/src/position_controller_indi.c:180:2: error: missing braces around initializer [-Werror=missing-braces]
float M_OB[3][3] = {0};
^
.//src/modules/src/position_controller_indi.c:180:2: error: (near initialization for 'M_OB[0]') [-Werror=missing-braces]
CC crc.o
.//src/modules/src/position_controller_indi.c: At top level:
cc1: error: unrecognized command line option "-Wno-address-of-packed-member" [-Werror]
cc1: all warnings being treated as errors
tools/make/targets.mk:26: recipe for target 'position_controller_indi.o' failed
make[1]: *** [position_controller_indi.o] Error 1
make[1]: *** Waiting for unfinished jobs....
Makefile:375: recipe for target 'build' failed
make: *** [build] Error 2

原因:
出现这样的提示 cc1plus: all warnings being treated as errors,原因是编译时候gcc配置把警告按错误处理
 
解决:
在Makefile中找到 -Werror项,删除即可。删除后重新编译。
cd crazyfile-firmware
vim Makeflie
rm ...
已邀请:

要回复问题请先登录注册