4.1 compiler errors, which compiler to use?

Hello, I’ve cloned ArduPilot and switched to the Copter-4.1 branch. I’ve updated the submodules, run the prerequisites script, and run “./waf configure” and now I’m trying to compile using “./waf copter”. However I’m getting compiler errors, shown below. I’m using Ubuntu 16.04, and the latest gcc-arm-none-eabi available for this OS (which is v10.3).

Is there a specific gcc version that’s required to build the project?

Thanks

The error has many of:

In file included from /opt/gcc-arm-none-eabi-10.3-2021.10/arm-none-eabi/include/c++/10.3.1/string:55,
                 from ../../ArduCopter/mode.h:4,
                 from ../../ArduCopter/RC_Channel.h:5,
                 from ../../ArduCopter/Copter.h:92,
                 from ../../ArduCopter/GCS_Mavlink.cpp:1:
/opt/gcc-arm-none-eabi-10.3-2021.10/arm-none-eabi/include/c++/10.3.1/bits/basic_string.h: In function 'std::string std::__cxx11::to_string(float)':
/opt/gcc-arm-none-eabi-10.3-2021.10/arm-none-eabi/include/c++/10.3.1/bits/basic_string.h:6674:50: error: 'vsnprintf' is not a member of 'std'; did you mean 'isprint'?
 6674 |     return __gnu_cxx::__to_xstring<string>(&std::vsnprintf, __n,
      |                                                  ^~~~~~~~~
      |                                                  isprint
compilation terminated due to -Wfatal-errors.

Ardupilot can use the following GCC-Arm versions: ArduPilot firmware : /Tools/STM32-tools

Thanks for the link, however it didn’t work for me.
Using " gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2" still results in the same vsnprintf error.

Are there other dependencies that gcc-arm-none-eabi is using?

In file included from /opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/c++/10.2.1/string:55,
                 from ../../ArduCopter/mode.h:4,
                 from ../../ArduCopter/RC_Channel.h:5,
                 from ../../ArduCopter/Copter.h:92,
                 from ../../ArduCopter/mode_systemid.cpp:1:
/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/c++/10.2.1/bits/basic_string.h: In function 'std::string std::__cxx11::to_string(float)':
/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/c++/10.2.1/bits/basic_string.h:6662:50: error: 'vsnprintf' is not a member of 'std'; did you mean 'isprint'?
 6662 |     return __gnu_cxx::__to_xstring<string>(&std::vsnprintf, __n,
      |                                                  ^~~~~~~~~
      |                                                  isprint
compilation terminated due to -Wfatal-errors.

Please include the the command you use to configure waf and the full output. And the command and full output from the build. You can pipe both to a text file.

The commands and full output have been included here:
CONFIGURE.TXT (3.5 KB)
COMPILE.TXT (51.6 KB)

I’m using gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2

I found a workaround: by editing the compiler (although probably not best practice), and making the below change allowed arducopter to finish the build.
The file I modified: gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/c++/10.2.1/bits/basic_string.h

Three occurrances of &std::vsnprintf were changed to vsnprintf

This will work for now, although I’m not sure why it’s necessary.

Where did you install gcc-arm to?

Your configure.txt reports that it is using gcc-arm from /usr/bin/, but you also mentioned having it in /opt/gcc-arm-none-eabi-10-2020-q4-major/. You may want to check you’ve not accidentally installed 2 copies of gcc-arm.