Compile error:" error: unknown option after '#pragma GCC diagnostic' kind [-Werror=pragmas]"

Dear all,

I tried to compile the master “ArduCopter V4.1.0-dev” on Ubuntu 20.04.
I am in trouble with the following error.

…/…/libraries/AP_UAVCAN/AP_UAVCAN.cpp:189:30: error: unknown option after ‘#pragma GCC diagnostic’ kind [-Werror = pragmas]
#pragma GCC diagnostic error “-Wframe-larger-than = 1400”
^ ^
compilation terminated due to -Wfatal-errors.
cc1plus: all warnings being treated as errors

Please let me know what to do.

Thank you.

You probably have the wrong version of gcc - you need 6.3.1q2 or later

Dear andyp1per-san,

Thank you for your advice.

I did “sudo apt install gcc-arm-none-eabi”,
and it works well!

Thank you, again.