Make px4fmu-v3_default fails with compilation error

Hi,

I’m trying to compile the PX4 Firmware based on the documentation here: Building the Code · PX4 Developer Guide

I’m trying to compile PX4 Firmware tag v.1.8.0

when I try:

$ arm-none-eabi-gcc --version
arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 5.4.1 20160919 (release) [ARM/embedded-5-branch revision 240496]
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

the the compilation fails with:

[ 78%] Building CXX object src/modules/commander/commander_tests/CMakeFiles/modules__commander__commander_tests.dir/__/state_machine_helper.cpp.obj
Scanning dependencies of target modules__mavlink__mavlink_tests
In file included from /home/am/src/gcc-arm-none-eabi-5_4-2016q3/arm-none-eabi/include/c++/5.4.1/bits/locale_facets.h:41:0,
                 from /home/am/src/gcc-arm-none-eabi-5_4-2016q3/arm-none-eabi/include/c++/5.4.1/bits/basic_ios.h:37,
                 from /home/am/src/gcc-arm-none-eabi-5_4-2016q3/arm-none-eabi/include/c++/5.4.1/ios:44,
                 from /home/am/src/gcc-arm-none-eabi-5_4-2016q3/arm-none-eabi/include/c++/5.4.1/ostream:38,
                 from /home/am/src/gcc-arm-none-eabi-5_4-2016q3/arm-none-eabi/include/c++/5.4.1/iostream:39,
                 from /home/am/src/PX4/Firmware/src/modules/commander/state_machine_helper.cpp:34:
/home/am/src/gcc-arm-none-eabi-5_4-2016q3/arm-none-eabi/include/c++/5.4.1/arm-none-eabi/armv7e-m/fpu/bits/ctype_base.h:44:35: error: '_U' was not declared in this scope 
     static const mask upper     = _U;
                                   ^
compilation terminated due to -Wfatal-errors.

if I try:

$ arm-none-eabi-gcc --version
arm-none-eabi-gcc (GNU Tools for Arm Embedded Processors 7-2017-q4-major) 7.2.1 20170904 (release) [ARM/embedded-7-branch revision 255204]
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I get:

[ 78%] Building CXX object src/modules/mavlink/mavlink_tests/CMakeFiles/modules__mavlink__mavlink_tests.dir/mavlink_tests.cpp.obj
In file included from /home/am/src/gcc-arm-none-eabi-7-2017-q4-major/arm-none-eabi/include/c++/7.2.1/string:52:0,
                 from /home/am/src/gcc-arm-none-eabi-7-2017-q4-major/arm-none-eabi/include/c++/7.2.1/bits/locale_classes.h:40,
                 from /home/am/src/gcc-arm-none-eabi-7-2017-q4-major/arm-none-eabi/include/c++/7.2.1/bits/ios_base.h:41,
                 from /home/am/src/gcc-arm-none-eabi-7-2017-q4-major/arm-none-eabi/include/c++/7.2.1/ios:42,
                 from /home/am/src/gcc-arm-none-eabi-7-2017-q4-major/arm-none-eabi/include/c++/7.2.1/ostream:38,
                 from /home/am/src/gcc-arm-none-eabi-7-2017-q4-major/arm-none-eabi/include/c++/7.2.1/iostream:39,
                 from /home/am/src/PX4/Firmware/src/modules/commander/state_machine_helper.cpp:34:
/home/am/src/gcc-arm-none-eabi-7-2017-q4-major/arm-none-eabi/include/c++/7.2.1/bits/basic_string.h: In function 'int std::__cxx11::stoi(const wstring&, size_t*, int)':
/home/am/src/gcc-arm-none-eabi-7-2017-q4-major/arm-none-eabi/include/c++/7.2.1/bits/basic_string.h:6276:47: error: 'wcstol' is not a member of 'std'
   { return __gnu_cxx::__stoa<long, int>(&std::wcstol, "stoi", __str.c_str(),
                                               ^~~~~~
compilation terminated due to -Wfatal-errors.

what am I doing wrong?

Akos

1 Like