Arduino fails to compile

[First of all, I apologize for my bad English. English is not my native language.]

I installed Ubuntu on a virtual machine. Then I followed the steps in this link “Setting up the Build Environment (Linux/Ubuntu) — Dev documentation” one by one. But I got an error in one step and I have been trying for days to solve this step.

After typing “./waf copter -v” I get an error like the one below.

../../libraries/AP_DroneCAN/AP_DroneCAN.cpp: In member function ‘void AP_DroneCAN::handle_ESC_status(const CanardRxTransfer&, const uavcan_equipment_esc_Status&)’:
../../libraries/AP_DroneCAN/AP_DroneCAN.cpp:1453:5: sorry, unimplemented: non-trivial designated initializers not supported
     };
     ^
compilation terminated due to -Wfatal-errors.

Waf: Leaving directory `/home/barankanat/ardupilot/build/sitl'
Build failed
 -> task in 'objs/AP_DroneCAN' failed (exit status 1): 
	{task 140481417940888: cxx AP_DroneCAN.cpp -> AP_DroneCAN.cpp.0.o}
 (run with -v to display more information)

Thank you very much in advance for your help.

Note: I am using GCC/G++ version 7.

Hi,
Did you clone the github repo using the --recurse-submodules tag ?
This is required to get the sub-modules that the main repo requires.
Also are you building the firmware for a specific board ? as no board tag is based so this will build the sitl firmware only.
Hope this helps.

Hello, thank you for your answer. I was able to solve this problem in the time it took.

I solved the problem by upgrading the version of the gcc/g++ module.

However, when I run Arducopter for Ardupilot, the map and console do not appear. How can I understand where the problem originates from?

please don’t use old ubuntu version. use at least 22.04

Thank you for your answer. However, I heard that some programs do not work in the new version. My goal is to code drone movement in a 3D environment with python. Do these programs Ardupilot, Arducopter, SITL, Gazebo work on the current version of Ubuntu?

Yes, see the dev wiki docs here: Using SITL with Gazebo — Dev documentation