compilation error using make
3 views (last 30 days)
Show older comments
I am have the following error while compiling the code using PixhawkPSP. I am using Matlab 2017b and windows 10.
[110/695] Building CXX object src/modules/px4iofirmware/CM...Files/px4io-v2.dir/__/systemlib/mixer/mixer_simple.cpp.obj
FAILED: /usr/bin/arm-none-eabi-g++ -DCONFIG_ARCH_BOARD_PX4IO_V2 -D__DF_NUTTX -D__PX4_NUTTX -D__STDC_FORMAT_MACROS -I. -Isrc -Isrc/modules -I../src -I../src/drivers/boards/px4io-v2 -I../src/include -I../src/lib -I../src/lib/DriverFramework/framework/include -I../src/lib/matrix -I../src/modules -I../src/platforms -Ipx4io-v2/NuttX/nuttx/nuttx-export/include -Ipx4io-v2/NuttX/nuttx/nuttx-export/include/cxx -Ipx4io-v2/NuttX/nuttx/nuttx-export/arch/chip -Ipx4io-v2/NuttX/nuttx/nuttx-export/arch/common -Ipx4io-v2/NuttX/nuttx/nuttx-export/arch/armv7-m -Ipx4io-v2/NuttX/apps/include -Isrc/modules/systemlib/mixer -g -fno-exceptions -fno-rtti -std=gnu++11 -fno-threadsafe-statics -DCONFIG_WCHAR_BUILTIN -D__CUSTOM_FILE_IO__ -fcheck-new -Wall -Warray-bounds -Werror -Wextra -Wfatal-errors -Wfloat-equal -Wformat-security -Winit-self -Wmissing-declarations -Wpointer-arith -Wshadow -Wuninitialized -Wunused-variable -Wno-sign-compare -Wno-unused-parameter -Wunused-but-set-variable -Wformat=1 -Wdouble-promotion -Wno-missing-field-initializers -Wreorder -fvisibility=hidden -include visibility.h -mcpu=cortex-m3 -mthumb -march=armv7-m -nodefaultlibs -nostdlib -fno-strict-aliasing -fomit-frame-pointer -funsafe-math-optimizations -ffunction-sections -fdata-sections -fno-strength-reduce -fno-builtin-printf -Os -DNDEBUG -MMD -MT src/modules/px4iofirmware/CMakeFiles/px4io-v2.dir/__/systemlib/mixer/mixer_simple.cpp.obj -MF src/modules/px4iofirmware/CMakeFiles/px4io-v2.dir/__/systemlib/mixer/mixer_simple.cpp.obj.d -o src/modules/px4iofirmware/CMakeFiles/px4io-v2.dir/__/systemlib/mixer/mixer_simple.cpp.obj -c ../src/modules/systemlib/mixer/mixer_simple.cpp
In file included from px4io-v2/NuttX/nuttx/nuttx-export/include/math.h:52:0,
from ../src/modules/systemlib/mixer/mixer_simple.cpp:51:
px4io-v2/NuttX/nuttx/nuttx-export/include/arch/math.h:87:20: error: expected initializer before '_PARAMS'
extern double atan _PARAMS((double));
^~~~~~~
compilation terminated due to -Wfatal-errors.
[110/695] Building CXX object src/platforms/common/CMakeFiles/platforms__common.dir/shutdown.cpp.obj
FAILED: /usr/bin/arm-none-eabi-g++ -DBUILD_URI=localhost -DCONFIG_ARCH_BOARD_PX4FMU_V3 -DMODULE_NAME=\"platforms__common\" -D__DF_NUTTX -D__PX4_NUTTX -D__STDC_FORMAT_MACROS -I. -Isrc -Isrc/modules -I../src -I../src/drivers/boards/px4fmu-v3 -I../src/include -I../src/lib -I../src/lib/DriverFramework/framework/include -I../src/lib/matrix -I../src/modules -I../src/platforms -Ipx4fmu-v3/NuttX/nuttx/nuttx-export/include -Ipx4fmu-v3/NuttX/nuttx/nuttx-export/include/cxx -Ipx4fmu-v3/NuttX/nuttx/nuttx-export/arch/chip -Ipx4fmu-v3/NuttX/nuttx/nuttx-export/arch/common -Ipx4fmu-v3/NuttX/nuttx/nuttx-export/arch/armv7-m -Ipx4fmu-v3/NuttX/apps/include -Iexternal/Install/include -g -fno-exceptions -fno-rtti -std=gnu++11 -fno-threadsafe-statics -DCONFIG_WCHAR_BUILTIN -D__CUSTOM_FILE_IO__ -fcheck-new -Wall -Warray-bounds -Werror -Wextra -Wfatal-errors -Wfloat-equal -Wformat-security -Winit-self -Wmissing-declarations -Wpointer-arith -Wshadow -Wuninitialized -Wunused-variable -Wno-sign-compare -Wno-unused-parameter -Wunused-but-set-variable -Wformat=1 -Wdouble-promotion -Wno-missing-field-initializers -Wreorder -fvisibility=hidden -include visibility.h -mcpu=cortex-m4 -mthumb -march=armv7e-m -mfpu=fpv4-sp-d16 -mfloat-abi=hard -nodefaultlibs -nostdlib -fno-strict-aliasing -fomit-frame-pointer -funsafe-math-optimizations -ffunction-sections -fdata-sections -fno-strength-reduce -fno-builtin-printf -Os -DNDEBUG -Wframe-larger-than=1024 -fno-strict-aliasing -fomit-frame-pointer -funsafe-math-optimizations -ffunction-sections -fdata-sections -fno-strength-reduce -fno-builtin-printf -MMD -MT src/platforms/common/CMakeFiles/platforms__common.dir/shutdown.cpp.obj -MF src/platforms/common/CMakeFiles/platforms__common.dir/shutdown.cpp.obj.d -o src/platforms/common/CMakeFiles/platforms__common.dir/shutdown.cpp.obj -c ../src/platforms/common/shutdown.cpp
In file included from px4fmu-v3/NuttX/nuttx/nuttx-export/include/math.h:52:0,
from px4fmu-v3/NuttX/nuttx/nuttx-export/include/cxx/cmath:46,
from ../src/platforms/px4_defines.h:67,
from ../src/platforms/px4_log.h:136,
from ../src/platforms/common/shutdown.cpp:40:
px4fmu-v3/NuttX/nuttx/nuttx-export/include/arch/math.h:87:20: error: expected initializer before '_PARAMS'
extern double atan _PARAMS((double));
^~~~~~~
compilation terminated due to -Wfatal-errors.
[110/695] Building C object src/modules/px4iofirmware/CMakeFiles/px4io-v2.dir/__/systemlib/perf_counter.c.obj
FAILED: /usr/bin/arm-none-eabi-gcc -DCONFIG_ARCH_BOARD_PX4IO_V2 -D__DF_NUTTX -D__PX4_NUTTX -D__STDC_FORMAT_MACROS -I. -Isrc -Isrc/modules -I../src -I../src/drivers/boards/px4io-v2 -I../src/include -I../src/lib -I../src/lib/DriverFramework/framework/include -I../src/lib/matrix -I../src/modules -I../src/platforms -Ipx4io-v2/NuttX/nuttx/nuttx-export/include -Ipx4io-v2/NuttX/nuttx/nuttx-export/include/cxx -Ipx4io-v2/NuttX/nuttx/nuttx-export/arch/chip -Ipx4io-v2/NuttX/nuttx/nuttx-export/arch/common -Ipx4io-v2/NuttX/nuttx/nuttx-export/arch/armv7-m -Ipx4io-v2/NuttX/apps/include -Isrc/modules/systemlib/mixer -g -std=gnu99 -fno-common -Wall -Warray-bounds -Werror -Wextra -Wfatal-errors -Wfloat-equal -Wformat-security -Winit-self -Wmissing-declarations -Wpointer-arith -Wshadow -Wuninitialized -Wunused-variable -Wno-sign-compare -Wno-unused-parameter -Wunused-but-set-variable -Wformat=1 -Wdouble-promotion -Wbad-function-cast -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -fvisibility=hidden -include visibility.h -mcpu=cortex-m3 -mthumb -march=armv7-m -nodefaultlibs -nostdlib -fno-strict-aliasing -fomit-frame-pointer -funsafe-math-optimizations -ffunction-sections -fdata-sections -fno-strength-reduce -fno-builtin-printf -Os -DNDEBUG -MMD -MT src/modules/px4iofirmware/CMakeFiles/px4io-v2.dir/__/systemlib/perf_counter.c.obj -MF src/modules/px4iofirmware/CMakeFiles/px4io-v2.dir/__/systemlib/perf_counter.c.obj.d -o src/modules/px4iofirmware/CMakeFiles/px4io-v2.dir/__/systemlib/perf_counter.c.obj -c ../src/modules/systemlib/perf_counter.c
In file included from px4io-v2/NuttX/nuttx/nuttx-export/include/math.h:52:0,
from ../src/modules/systemlib/perf_counter.c:45:
px4io-v2/NuttX/nuttx/nuttx-export/include/arch/math.h:87:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before '_PARAMS'
extern double atan _PARAMS((double));
^~~~~~~
compilation terminated due to -Wfatal-errors.
ninja: build stopped: subcommand failed.
Makefile:164: recipe for target 'px4fmu-v3_default' failed
make: *** [px4fmu-v3_default] Error 1
C:\WINDOWS\system32>bash
gdd@DESKTOP-0C9MNBU:/mnt/c/Windows/System32$ cd ..
gdd@DESKTOP-0C9MNBU:/mnt/c/Windows$ cd ..
gdd@DESKTOP-0C9MNBU:/mnt/c$ cd PX4/
gdd@DESKTOP-0C9MNBU:/mnt/c/PX4$ cd Firmware/
gdd@DESKTOP-0C9MNBU:/mnt/c/PX4/Firmware$ cmake px4fmu-v3_default
CMake Error: The source directory "/mnt/c/PX4/Firmware/px4fmu-v3_default" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
gdd@DESKTOP-0C9MNBU:/mnt/c/PX4/Firmware$ sudo cmake px4fmu-v3_default
[sudo] password for gdd:
CMake Error: The source directory "/mnt/c/PX4/Firmware/px4fmu-v3_default" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
gdd@DESKTOP-0C9MNBU:/mnt/c/PX4/Firmware$ sudo cmake px4fmu-v3_default
CMake Error: The source directory "/mnt/c/PX4/Firmware/px4fmu-v3_default" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
gdd@DESKTOP-0C9MNBU:/mnt/c/PX4/Firmware$ ls
build_px4fmu-v3_default CTestConfig.cmake Firmware.sublime-project Makefile nuttx-configs ROMFS
circle.yml Debug Images mavlink nuttx-patches src
cmake Documentation integrationtests misc package.xml test_data
CMakeLists.txt eclipse.cproject launch msg posix-configs Tools
CONTRIBUTING.md eclipse.project LICENSE.md NuttX README.md Vagrantfile
gdd@DESKTOP-0C9MNBU:/mnt/c/PX4/Firmware$ sudo cmake px4fmu-v3_default
CMake Error: The source directory "/mnt/c/PX4/Firmware/px4fmu-v3_default" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
gdd@DESKTOP-0C9MNBU:/mnt/c/PX4/Firmware$ sudo make px4fmu-v3_default
[6/588] Building C object src/modules/px4iofirmware/CMakeFiles/px4io-v2.dir/__/systemlib/pwm_limit/pwm_limit.c.obj
FAILED: /usr/bin/arm-none-eabi-gcc -DCONFIG_ARCH_BOARD_PX4IO_V2 -D__DF_NUTTX -D__PX4_NUTTX -D__STDC_FORMAT_MACROS -I. -Isrc -Isrc/modules -I../src -I../src/drivers/boards/px4io-v2 -I../src/include -I../src/lib -I../src/lib/DriverFramework/framework/include -I../src/lib/matrix -I../src/modules -I../src/platforms -Ipx4io-v2/NuttX/nuttx/nuttx-export/include -Ipx4io-v2/NuttX/nuttx/nuttx-export/include/cxx -Ipx4io-v2/NuttX/nuttx/nuttx-export/arch/chip -Ipx4io-v2/NuttX/nuttx/nuttx-export/arch/common -Ipx4io-v2/NuttX/nuttx/nuttx-export/arch/armv7-m -Ipx4io-v2/NuttX/apps/include -Isrc/modules/systemlib/mixer -g -std=gnu99 -fno-common -Wall -Warray-bounds -Werror -Wextra -Wfatal-errors -Wfloat-equal -Wformat-security -Winit-self -Wmissing-declarations -Wpointer-arith -Wshadow -Wuninitialized -Wunused-variable -Wno-sign-compare -Wno-unused-parameter -Wunused-but-set-variable -Wformat=1 -Wdouble-promotion -Wbad-function-cast -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -fvisibility=hidden -include visibility.h -mcpu=cortex-m3 -mthumb -march=armv7-m -nodefaultlibs -nostdlib -fno-strict-aliasing -fomit-frame-pointer -funsafe-math-optimizations -ffunction-sections -fdata-sections -fno-strength-reduce -fno-builtin-printf -Os -DNDEBUG -MMD -MT src/modules/px4iofirmware/CMakeFiles/px4io-v2.dir/__/systemlib/pwm_limit/pwm_limit.c.obj -MF src/modules/px4iofirmware/CMakeFiles/px4io-v2.dir/__/systemlib/pwm_limit/pwm_limit.c.obj.d -o src/modules/px4iofirmware/CMakeFiles/px4io-v2.dir/__/systemlib/pwm_limit/pwm_limit.c.obj -c ../src/modules/systemlib/pwm_limit/pwm_limit.c
In file included from px4io-v2/NuttX/nuttx/nuttx-export/include/math.h:52:0,
from ../src/modules/systemlib/pwm_limit/pwm_limit.c:44:
px4io-v2/NuttX/nuttx/nuttx-export/include/arch/math.h:87:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before '_PARAMS'
extern double atan _PARAMS((double));
^~~~~~~
compilation terminated due to -Wfatal-errors.
[6/588] Building C object src/modules/px4iofirmware/CMakeFiles/px4io-v2.dir/__/systemlib/perf_counter.c.obj
FAILED: /usr/bin/arm-none-eabi-gcc -DCONFIG_ARCH_BOARD_PX4IO_V2 -D__DF_NUTTX -D__PX4_NUTTX -D__STDC_FORMAT_MACROS -I. -Isrc -Isrc/modules -I../src -I../src/drivers/boards/px4io-v2 -I../src/include -I../src/lib -I../src/lib/DriverFramework/framework/include -I../src/lib/matrix -I../src/modules -I../src/platforms -Ipx4io-v2/NuttX/nuttx/nuttx-export/include -Ipx4io-v2/NuttX/nuttx/nuttx-export/include/cxx -Ipx4io-v2/NuttX/nuttx/nuttx-export/arch/chip -Ipx4io-v2/NuttX/nuttx/nuttx-export/arch/common -Ipx4io-v2/NuttX/nuttx/nuttx-export/arch/armv7-m -Ipx4io-v2/NuttX/apps/include -Isrc/modules/systemlib/mixer -g -std=gnu99 -fno-common -Wall -Warray-bounds -Werror -Wextra -Wfatal-errors -Wfloat-equal -Wformat-security -Winit-self -Wmissing-declarations -Wpointer-arith -Wshadow -Wuninitialized -Wunused-variable -Wno-sign-compare -Wno-unused-parameter -Wunused-but-set-variable -Wformat=1 -Wdouble-promotion -Wbad-function-cast -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -fvisibility=hidden -include visibility.h -mcpu=cortex-m3 -mthumb -march=armv7-m -nodefaultlibs -nostdlib -fno-strict-aliasing -fomit-frame-pointer -funsafe-math-optimizations -ffunction-sections -fdata-sections -fno-strength-reduce -fno-builtin-printf -Os -DNDEBUG -MMD -MT src/modules/px4iofirmware/CMakeFiles/px4io-v2.dir/__/systemlib/perf_counter.c.obj -MF src/modules/px4iofirmware/CMakeFiles/px4io-v2.dir/__/systemlib/perf_counter.c.obj.d -o src/modules/px4iofirmware/CMakeFiles/px4io-v2.dir/__/systemlib/perf_counter.c.obj -c ../src/modules/systemlib/perf_counter.c
In file included from px4io-v2/NuttX/nuttx/nuttx-export/include/math.h:52:0,
from ../src/modules/systemlib/perf_counter.c:45:
px4io-v2/NuttX/nuttx/nuttx-export/include/arch/math.h:87:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before '_PARAMS'
extern double atan _PARAMS((double));
^~~~~~~
compilation terminated due to -Wfatal-errors.
[6/588] Building CXX object src/platforms/common/CMakeFiles/platforms__common.dir/shutdown.cpp.obj
FAILED: /usr/bin/arm-none-eabi-g++ -DBUILD_URI=localhost -DCONFIG_ARCH_BOARD_PX4FMU_V3 -DMODULE_NAME=\"platforms__common\" -D__DF_NUTTX -D__PX4_NUTTX -D__STDC_FORMAT_MACROS -I. -Isrc -Isrc/modules -I../src -I../src/drivers/boards/px4fmu-v3 -I../src/include -I../src/lib -I../src/lib/DriverFramework/framework/include -I../src/lib/matrix -I../src/modules -I../src/platforms -Ipx4fmu-v3/NuttX/nuttx/nuttx-export/include -Ipx4fmu-v3/NuttX/nuttx/nuttx-export/include/cxx -Ipx4fmu-v3/NuttX/nuttx/nuttx-export/arch/chip -Ipx4fmu-v3/NuttX/nuttx/nuttx-export/arch/common -Ipx4fmu-v3/NuttX/nuttx/nuttx-export/arch/armv7-m -Ipx4fmu-v3/NuttX/apps/include -Iexternal/Install/include -g -fno-exceptions -fno-rtti -std=gnu++11 -fno-threadsafe-statics -DCONFIG_WCHAR_BUILTIN -D__CUSTOM_FILE_IO__ -fcheck-new -Wall -Warray-bounds -Werror -Wextra -Wfatal-errors -Wfloat-equal -Wformat-security -Winit-self -Wmissing-declarations -Wpointer-arith -Wshadow -Wuninitialized -Wunused-variable -Wno-sign-compare -Wno-unused-parameter -Wunused-but-set-variable -Wformat=1 -Wdouble-promotion -Wno-missing-field-initializers -Wreorder -fvisibility=hidden -include visibility.h -mcpu=cortex-m4 -mthumb -march=armv7e-m -mfpu=fpv4-sp-d16 -mfloat-abi=hard -nodefaultlibs -nostdlib -fno-strict-aliasing -fomit-frame-pointer -funsafe-math-optimizations -ffunction-sections -fdata-sections -fno-strength-reduce -fno-builtin-printf -Os -DNDEBUG -Wframe-larger-than=1024 -fno-strict-aliasing -fomit-frame-pointer -funsafe-math-optimizations -ffunction-sections -fdata-sections -fno-strength-reduce -fno-builtin-printf -MMD -MT src/platforms/common/CMakeFiles/platforms__common.dir/shutdown.cpp.obj -MF src/platforms/common/CMakeFiles/platforms__common.dir/shutdown.cpp.obj.d -o src/platforms/common/CMakeFiles/platforms__common.dir/shutdown.cpp.obj -c ../src/platforms/common/shutdown.cpp
In file included from px4fmu-v3/NuttX/nuttx/nuttx-export/include/math.h:52:0,
from px4fmu-v3/NuttX/nuttx/nuttx-export/include/cxx/cmath:46,
from ../src/platforms/px4_defines.h:67,
from ../src/platforms/px4_log.h:136,
from ../src/platforms/common/shutdown.cpp:40:
px4fmu-v3/NuttX/nuttx/nuttx-export/include/arch/math.h:87:20: error: expected initializer before '_PARAMS'
extern double atan _PARAMS((double));
^~~~~~~
compilation terminated due to -Wfatal-errors.
[6/588] Building CXX object src/modules/px4iofirmware/CMakeFiles/px4io-v2.dir/__/systemlib/mixer/mixer_simple.cpp.obj
FAILED: /usr/bin/arm-none-eabi-g++ -DCONFIG_ARCH_BOARD_PX4IO_V2 -D__DF_NUTTX -D__PX4_NUTTX -D__STDC_FORMAT_MACROS -I. -Isrc -Isrc/modules -I../src -I../src/drivers/boards/px4io-v2 -I../src/include -I../src/lib -I../src/lib/DriverFramework/framework/include -I../src/lib/matrix -I../src/modules -I../src/platforms -Ipx4io-v2/NuttX/nuttx/nuttx-export/include -Ipx4io-v2/NuttX/nuttx/nuttx-export/include/cxx -Ipx4io-v2/NuttX/nuttx/nuttx-export/arch/chip -Ipx4io-v2/NuttX/nuttx/nuttx-export/arch/common -Ipx4io-v2/NuttX/nuttx/nuttx-export/arch/armv7-m -Ipx4io-v2/NuttX/apps/include -Isrc/modules/systemlib/mixer -g -fno-exceptions -fno-rtti -std=gnu++11 -fno-threadsafe-statics -DCONFIG_WCHAR_BUILTIN -D__CUSTOM_FILE_IO__ -fcheck-new -Wall -Warray-bounds -Werror -Wextra -Wfatal-errors -Wfloat-equal -Wformat-security -Winit-self -Wmissing-declarations -Wpointer-arith -Wshadow -Wuninitialized -Wunused-variable -Wno-sign-compare -Wno-unused-parameter -Wunused-but-set-variable -Wformat=1 -Wdouble-promotion -Wno-missing-field-initializers -Wreorder -fvisibility=hidden -include visibility.h -mcpu=cortex-m3 -mthumb -march=armv7-m -nodefaultlibs -nostdlib -fno-strict-aliasing -fomit-frame-pointer -funsafe-math-optimizations -ffunction-sections -fdata-sections -fno-strength-reduce -fno-builtin-printf -Os -DNDEBUG -MMD -MT src/modules/px4iofirmware/CMakeFiles/px4io-v2.dir/__/systemlib/mixer/mixer_simple.cpp.obj -MF src/modules/px4iofirmware/CMakeFiles/px4io-v2.dir/__/systemlib/mixer/mixer_simple.cpp.obj.d -o src/modules/px4iofirmware/CMakeFiles/px4io-v2.dir/__/systemlib/mixer/mixer_simple.cpp.obj -c ../src/modules/systemlib/mixer/mixer_simple.cpp
In file included from px4io-v2/NuttX/nuttx/nuttx-export/include/math.h:52:0,
from ../src/modules/systemlib/mixer/mixer_simple.cpp:51:
px4io-v2/NuttX/nuttx/nuttx-export/include/arch/math.h:87:20: error: expected initializer before '_PARAMS'
extern double atan _PARAMS((double));
^~~~~~~
compilation terminated due to -Wfatal-errors.
[6/588] Building C object src/modules/px4iofirmware/CMakeFiles/px4io-v2.dir/adc.c.obj
ninja: build stopped: subcommand failed.
Makefile:164: recipe for target 'px4fmu-v3_default' failed
make: *** [px4fmu-v3_default] Error 1
4 Comments
Image Analyst
on 21 Aug 2018
You listed your product as the MATLAB and Simulink Student Suite. I don't believe that product allows compilation.
Walter Roberson
on 21 Aug 2018
You will need to reconfigure so that warnings are not treated as errors. The code at that location has
case 'd': sign = true;
/* FALLTHROUGH */
case 'u': base = 10; break;
which is valid C, even if it could be better written.
Answers (1)
Dinesh
on 22 Aug 2018
1 Comment
Walter Roberson
on 22 Aug 2018
Something in your compilation chain is compiling with
-Werror=implicit-fallthrough=
You need to either remove that or else add
-Wno-error=implicit-fallthrough=
(I do not know what would happen if both appear on the same command line.)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!