arduino / ArduinoCore-nRF528x-mbedos

[Archived] Arduino core supporting mbed-enabled boards
86 stars 34 forks source link

mbed BSP includes `-I.` in compiler flags #26

Closed dhalbert closed 5 years ago

dhalbert commented 5 years ago

Using Arduino: 1.8.10 (tar file unpacked into personal bin directory) Arduino nRF528x (Mbed OS) 1.1.2 on Ubuntu 18.04 x64

I get compilation errors when compiling the canonical Blink example. Blink compiles fine on Windows 10 with the same BSP and Arduino versions. After the first failure I removed .arduino15 and reinstalled the BSP to make sure everything was clean, and the errors still occur.

Arduino: 1.8.10 (Linux), Board: "Arduino Nano 33 BLE"

/home/halbert/bin/arduino-1.8.10/arduino-builder -dump-prefs -logger=machine -hardware /home/halbert/bin/arduino-1.8.10/hardware -hardware /home/halbert/.arduino15/packages -tools /home/halbert/bin/arduino-1.8.10/tools-builder -tools /home/halbert/bin/arduino-1.8.10/hardware/tools/avr -tools /home/halbert/.arduino15/packages -built-in-libraries /home/halbert/bin/arduino-1.8.10/libraries -libraries /home/halbert/Arduino/libraries -fqbn=arduino:mbed:nano33ble -ide-version=10810 -build-path /tmp/arduino_build_565364 -warnings=none -build-cache /tmp/arduino_cache_113244 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arm-none-eabi-gcc.path=/home/halbert/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4 -prefs=runtime.tools.arm-none-eabi-gcc-7-2017q4.path=/home/halbert/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4 -prefs=runtime.tools.bossac.path=/home/halbert/.arduino15/packages/arduino/tools/bossac/1.9.1-arduino1 -prefs=runtime.tools.bossac-1.9.1-arduino1.path=/home/halbert/.arduino15/packages/arduino/tools/bossac/1.9.1-arduino1 -prefs=runtime.tools.openocd.path=/home/halbert/.arduino15/packages/arduino/tools/openocd/0.10.0-arduino9 -prefs=runtime.tools.openocd-0.10.0-arduino9.path=/home/halbert/.arduino15/packages/arduino/tools/openocd/0.10.0-arduino9 -verbose /home/halbert/Arduino/Blink/Blink.ino
/home/halbert/bin/arduino-1.8.10/arduino-builder -compile -logger=machine -hardware /home/halbert/bin/arduino-1.8.10/hardware -hardware /home/halbert/.arduino15/packages -tools /home/halbert/bin/arduino-1.8.10/tools-builder -tools /home/halbert/bin/arduino-1.8.10/hardware/tools/avr -tools /home/halbert/.arduino15/packages -built-in-libraries /home/halbert/bin/arduino-1.8.10/libraries -libraries /home/halbert/Arduino/libraries -fqbn=arduino:mbed:nano33ble -ide-version=10810 -build-path /tmp/arduino_build_565364 -warnings=none -build-cache /tmp/arduino_cache_113244 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arm-none-eabi-gcc.path=/home/halbert/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4 -prefs=runtime.tools.arm-none-eabi-gcc-7-2017q4.path=/home/halbert/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4 -prefs=runtime.tools.bossac.path=/home/halbert/.arduino15/packages/arduino/tools/bossac/1.9.1-arduino1 -prefs=runtime.tools.bossac-1.9.1-arduino1.path=/home/halbert/.arduino15/packages/arduino/tools/bossac/1.9.1-arduino1 -prefs=runtime.tools.openocd.path=/home/halbert/.arduino15/packages/arduino/tools/openocd/0.10.0-arduino9 -prefs=runtime.tools.openocd-0.10.0-arduino9.path=/home/halbert/.arduino15/packages/arduino/tools/openocd/0.10.0-arduino9 -verbose /home/halbert/Arduino/Blink/Blink.ino
Using board 'nano33ble' from platform in folder: /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2
Using core 'arduino' from platform in folder: /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2
Detecting libraries used...
/home/halbert/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-g++ -c -I. -w -g -Os -nostdlib @/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/variants/ARDUINO_NANO33BLE/defines.txt @/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/variants/ARDUINO_NANO33BLE/cxxflags.txt -DARDUINO_ARCH_NRF52840 -mcpu=cortex-m4 -w -x c++ -E -CC -DARDUINO=10810 -DARDUINO_ARDUINO_NANO33BLE -DARDUINO_ARCH_MBED -I/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino -I/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/variants/ARDUINO_NANO33BLE -I/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/api/deprecated -iprefix/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino @/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/variants/ARDUINO_NANO33BLE/includes.txt /tmp/arduino_build_565364/sketch/Blink.ino.cpp -o /dev/null
Generating function prototypes...
/home/halbert/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-g++ -c -I. -w -g -Os -nostdlib @/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/variants/ARDUINO_NANO33BLE/defines.txt @/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/variants/ARDUINO_NANO33BLE/cxxflags.txt -DARDUINO_ARCH_NRF52840 -mcpu=cortex-m4 -w -x c++ -E -CC -DARDUINO=10810 -DARDUINO_ARDUINO_NANO33BLE -DARDUINO_ARCH_MBED -I/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino -I/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/variants/ARDUINO_NANO33BLE -I/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/api/deprecated -iprefix/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino @/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/variants/ARDUINO_NANO33BLE/includes.txt /tmp/arduino_build_565364/sketch/Blink.ino.cpp -o /tmp/arduino_build_565364/preproc/ctags_target_for_gcc_minus_e.cpp
/home/halbert/bin/arduino-1.8.10/tools-builder/ctags/5.8-arduino11/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives /tmp/arduino_build_565364/preproc/ctags_target_for_gcc_minus_e.cpp
Compiling sketch...
/home/halbert/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-g++ -c -I. -w -g -Os -nostdlib @/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/variants/ARDUINO_NANO33BLE/defines.txt @/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/variants/ARDUINO_NANO33BLE/cxxflags.txt -DARDUINO_ARCH_NRF52840 -MMD -mcpu=cortex-m4 -DARDUINO=10810 -DARDUINO_ARDUINO_NANO33BLE -DARDUINO_ARCH_MBED -I/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino -I/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/variants/ARDUINO_NANO33BLE -I/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/api/deprecated -iprefix/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino @/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/variants/ARDUINO_NANO33BLE/includes.txt /tmp/arduino_build_565364/sketch/Blink.ino.cpp -o /tmp/arduino_build_565364/sketch/Blink.ino.cpp.o
In file included from /home/halbert/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/functional:53:0,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/platform/cxxsupport/mstd_type_traits:1205,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/platform/mbed_atomic.h:884,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/features/netsocket/InternetSocket.h:28,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/features/netsocket/UDPSocket.h:23,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/features/netsocket/nsapi.h:40,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/mbed.h:27,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/Arduino.h:32,
                 from /tmp/arduino_build_565364/sketch/Blink.ino.cpp:1:
./new:1:40: error: redefinition of 'const uint8_t hid_report_descriptor [195]'
 const uint8_t hid_report_descriptor[195] = {
                                        ^
In file included from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/platform/Callback.h:22:0,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/rtos/Thread.h:29,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/rtos/rtos.h:28,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/mbed.h:23,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/Arduino.h:32,
                 from /tmp/arduino_build_565364/sketch/Blink.ino.cpp:1:
./new:1:15: note: 'const uint8_t hid_report_descriptor [195]' previously defined here
 const uint8_t hid_report_descriptor[195] = {
               ^~~~~~~~~~~~~~~~~~~~~
In file included from /home/halbert/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/bits/exception_ptr.h:40:0,
                 from /home/halbert/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/exception:142,
                 from /home/halbert/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/stdexcept:38,
                 from /home/halbert/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/array:39,
                 from /home/halbert/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/tuple:39,
                 from /home/halbert/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/functional:54,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/platform/cxxsupport/mstd_type_traits:1205,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/platform/mbed_atomic.h:884,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/features/netsocket/InternetSocket.h:28,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/features/netsocket/UDPSocket.h:23,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/features/netsocket/nsapi.h:40,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/mbed.h:27,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/Arduino.h:32,
                 from /tmp/arduino_build_565364/sketch/Blink.ino.cpp:1:
./new:1:40: error: redefinition of 'const uint8_t hid_report_descriptor [195]'
 const uint8_t hid_report_descriptor[195] = {
                                        ^
In file included from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/platform/Callback.h:22:0,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/rtos/Thread.h:29,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/rtos/rtos.h:28,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/mbed.h:23,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/Arduino.h:32,
                 from /tmp/arduino_build_565364/sketch/Blink.ino.cpp:1:
./new:1:15: note: 'const uint8_t hid_report_descriptor [195]' previously defined here
 const uint8_t hid_report_descriptor[195] = {
               ^~~~~~~~~~~~~~~~~~~~~
In file included from /home/halbert/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/ext/new_allocator.h:33:0,
                 from /home/halbert/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/arm-none-eabi/thumb/v7e-m/fpv4-sp/softfp/bits/c++allocator.h:33,
                 from /home/halbert/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/bits/allocator.h:46,
                 from /home/halbert/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/string:41,
                 from /home/halbert/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/stdexcept:39,
                 from /home/halbert/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/array:39,
                 from /home/halbert/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/tuple:39,
                 from /home/halbert/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/functional:54,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/platform/cxxsupport/mstd_type_traits:1205,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/platform/mbed_atomic.h:884,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/features/netsocket/InternetSocket.h:28,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/features/netsocket/UDPSocket.h:23,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/features/netsocket/nsapi.h:40,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/mbed.h:27,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/Arduino.h:32,
                 from /tmp/arduino_build_565364/sketch/Blink.ino.cpp:1:
./new:1:40: error: redefinition of 'const uint8_t hid_report_descriptor [195]'
 const uint8_t hid_report_descriptor[195] = {
                                        ^
In file included from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/platform/Callback.h:22:0,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/rtos/Thread.h:29,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/rtos/rtos.h:28,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/mbed.h:23,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/Arduino.h:32,
                 from /tmp/arduino_build_565364/sketch/Blink.ino.cpp:1:
./new:1:15: note: 'const uint8_t hid_report_descriptor [195]' previously defined here
 const uint8_t hid_report_descriptor[195] = {
               ^~~~~~~~~~~~~~~~~~~~~
In file included from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/platform/SingletonPtr.h:30:0,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/features/netsocket/SocketStats.h:20,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/features/netsocket/InternetSocket.h:30,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/features/netsocket/UDPSocket.h:23,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/features/netsocket/nsapi.h:40,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/mbed.h:27,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/Arduino.h:32,
                 from /tmp/arduino_build_565364/sketch/Blink.ino.cpp:1:
./new:1:40: error: redefinition of 'const uint8_t hid_report_descriptor [195]'
 const uint8_t hid_report_descriptor[195] = {
                                        ^
In file included from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/platform/Callback.h:22:0,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/rtos/Thread.h:29,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/rtos/rtos.h:28,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/mbed.h:23,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/Arduino.h:32,
                 from /tmp/arduino_build_565364/sketch/Blink.ino.cpp:1:
./new:1:15: note: 'const uint8_t hid_report_descriptor [195]' previously defined here
 const uint8_t hid_report_descriptor[195] = {
               ^~~~~~~~~~~~~~~~~~~~~
In file included from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/events/EventQueue.h:25:0,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/events/mbed_events.h:21,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/mbed.h:32,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/Arduino.h:32,
                 from /tmp/arduino_build_565364/sketch/Blink.ino.cpp:1:
./new:1:40: error: redefinition of 'const uint8_t hid_report_descriptor [195]'
 const uint8_t hid_report_descriptor[195] = {
                                        ^
In file included from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/platform/Callback.h:22:0,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/rtos/Thread.h:29,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/rtos/rtos.h:28,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/mbed.h:23,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/Arduino.h:32,
                 from /tmp/arduino_build_565364/sketch/Blink.ino.cpp:1:
./new:1:15: note: 'const uint8_t hid_report_descriptor [195]' previously defined here
 const uint8_t hid_report_descriptor[195] = {
               ^~~~~~~~~~~~~~~~~~~~~
In file included from /home/halbert/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/bits/stl_construct.h:59:0,
                 from /home/halbert/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/bits/stl_tempbuf.h:60,
                 from /home/halbert/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/bits/stl_algo.h:62,
                 from /home/halbert/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/algorithm:62,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/drivers/FlashIAP.h:31,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/mbed.h:75,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/Arduino.h:32,
                 from /tmp/arduino_build_565364/sketch/Blink.ino.cpp:1:
./new:1:40: error: redefinition of 'const uint8_t hid_report_descriptor [195]'
 const uint8_t hid_report_descriptor[195] = {
                                        ^
In file included from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/platform/Callback.h:22:0,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/rtos/Thread.h:29,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/rtos/rtos.h:28,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/mbed.h:23,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/Arduino.h:32,
                 from /tmp/arduino_build_565364/sketch/Blink.ino.cpp:1:
./new:1:15: note: 'const uint8_t hid_report_descriptor [195]' previously defined here
 const uint8_t hid_report_descriptor[195] = {
               ^~~~~~~~~~~~~~~~~~~~~
In file included from /home/halbert/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/bits/stl_algo.h:62:0,
                 from /home/halbert/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/algorithm:62,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/drivers/FlashIAP.h:31,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/mbed.h:75,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/Arduino.h:32,
                 from /tmp/arduino_build_565364/sketch/Blink.ino.cpp:1:
/home/halbert/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/bits/stl_tempbuf.h: In function 'std::pair<_Tp*, int> std::get_temporary_buffer(std::ptrdiff_t)':
/home/halbert/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/bits/stl_tempbuf.h:95:13: error: 'nothrow' is not a member of 'std'
        std::nothrow));
             ^~~~~~~
/home/halbert/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/bits/stl_tempbuf.h: In function 'void std::return_temporary_buffer(_Tp*)':
/home/halbert/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/bits/stl_tempbuf.h:113:35: error: 'nothrow' is not a member of 'std'
     { ::operator delete(__p, std::nothrow); }
                                   ^~~~~~~
In file included from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/rtos/Thread.h:29:0,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/rtos/rtos.h:28,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/mbed.h:23,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/Arduino.h:32,
                 from /tmp/arduino_build_565364/sketch/Blink.ino.cpp:1:
/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/platform/Callback.h: In instantiation of 'mbed::Callback<R(ArgTs ...)>& mbed::Callback<R(ArgTs ...)>::operator=(const mbed::Callback<R(ArgTs ...)>&) [with R = void; ArgTs = {}]':
/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/USB/PluggableUSBSerial.h:174:47:   required from here
/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/platform/Callback.h:562:13: error: no matching function for call to 'operator new(sizetype, mbed::Callback<void()>*)'
             new (this) Callback(that);
             ^~~~~~~~~~~~~~~~~~~~~~~~~
<built-in>: note: candidate: void* operator new(unsigned int)
<built-in>: note:   candidate expects 1 argument, 2 provided
/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/platform/Callback.h: In instantiation of 'void mbed::Callback<R(ArgTs ...)>::generate(const Mbed_F&) [with Mbed_F = void (*)(); R = void; ArgTs = {}]':
/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/platform/Callback.h:89:21:   required from 'mbed::Callback<R(ArgTs ...)>::Callback(R (*)(ArgTs ...)) [with R = void; ArgTs = {}]'
/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/rtos/Thread.h:103:5:   required from here
/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/platform/Callback.h:647:9: error: no matching function for call to 'operator new(sizetype, mbed::Callback<void()>*)'
         new (this) F(f);
         ^~~~~~~~~~~~~~~
<built-in>: note: candidate: void* operator new(unsigned int)
<built-in>: note:   candidate expects 1 argument, 2 provided
In file included from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/features/netsocket/SocketStats.h:20:0,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/features/netsocket/InternetSocket.h:30,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/features/netsocket/UDPSocket.h:23,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/features/netsocket/nsapi.h:40,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/mbed.h:27,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/Arduino.h:32,
                 from /tmp/arduino_build_565364/sketch/Blink.ino.cpp:1:
/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/platform/SingletonPtr.h: In instantiation of 'T* SingletonPtr<T>::get() const [with T = rtos::Mutex]':
/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/platform/SingletonPtr.h:150:19:   required from 'T* SingletonPtr<T>::operator->() const [with T = rtos::Mutex]'
/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/drivers/AnalogIn.h:117:15:   required from here
/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/platform/SingletonPtr.h:132:21: error: no matching function for call to 'operator new(sizetype, char [36])'
                 p = new (_data) T();
                     ^~~~~~~~~~~~~~~
<built-in>: note: candidate: void* operator new(unsigned int)
<built-in>: note:   candidate expects 1 argument, 2 provided
In file included from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/rtos/Thread.h:29:0,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/rtos/rtos.h:28,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/mbed.h:23,
                 from /home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/Arduino.h:32,
                 from /tmp/arduino_build_565364/sketch/Blink.ino.cpp:1:
/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/platform/Callback.h: In instantiation of 'static void mbed::Callback<R(ArgTs ...)>::function_move(void*, const void*) [with Mbed_F = void (*)(); R = void; ArgTs = {}]':
/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/platform/Callback.h:638:26:   required from 'void mbed::Callback<R(ArgTs ...)>::generate(const Mbed_F&) [with Mbed_F = void (*)(); R = void; ArgTs = {}]'
/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/platform/Callback.h:89:21:   required from 'mbed::Callback<R(ArgTs ...)>::Callback(R (*)(ArgTs ...)) [with R = void; ArgTs = {}]'
/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/rtos/Thread.h:103:5:   required from here
/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/platform/Callback.h:661:9: error: no matching function for call to 'operator new(sizetype, void*&)'
         new (d) F(*(F *)p);
         ^~~~~~~~~~~~~~~~~~
<built-in>: note: candidate: void* operator new(unsigned int)
<built-in>: note:   candidate expects 1 argument, 2 provided
/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/platform/Callback.h: In instantiation of 'void mbed::Callback<R(ArgTs ...)>::generate(const Mbed_F&) [with Mbed_F = mbed::Callback<void()>::function_context<void (*)(void*), void>; R = void; ArgTs = {}]':
/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/platform/Callback.h:152:17:   required from 'mbed::Callback<R(ArgTs ...)>::Callback(R (*)(T*, ArgTs ...), U*) [with T = void; U = void; R = void; ArgTs = {}]'
/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/platform/Callback.h:783:12:   required from 'mbed::Callback<R(ArgTs ...)> mbed::callback(R (*)(T*, ArgTs ...), U*) [with T = void; U = void; R = void; ArgTs = {}]'
/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/rtos/Thread.h:253:68:   required from here
/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/platform/Callback.h:647:9: error: no matching function for call to 'operator new(sizetype, mbed::Callback<void()>*)'
         new (this) F(f);
         ^~~~~~~~~~~~~~~
<built-in>: note: candidate: void* operator new(unsigned int)
<built-in>: note:   candidate expects 1 argument, 2 provided
/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/platform/Callback.h: In instantiation of 'static void mbed::Callback<R(ArgTs ...)>::function_move(void*, const void*) [with Mbed_F = mbed::Callback<void()>::function_context<void (*)(void*), void>; R = void; ArgTs = {}]':
/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/platform/Callback.h:638:26:   required from 'void mbed::Callback<R(ArgTs ...)>::generate(const Mbed_F&) [with Mbed_F = mbed::Callback<void()>::function_context<void (*)(void*), void>; R = void; ArgTs = {}]'
/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/platform/Callback.h:152:17:   required from 'mbed::Callback<R(ArgTs ...)>::Callback(R (*)(T*, ArgTs ...), U*) [with T = void; U = void; R = void; ArgTs = {}]'
/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/platform/Callback.h:783:12:   required from 'mbed::Callback<R(ArgTs ...)> mbed::callback(R (*)(T*, ArgTs ...), U*) [with T = void; U = void; R = void; ArgTs = {}]'
/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/rtos/Thread.h:253:68:   required from here
/home/halbert/.arduino15/packages/arduino/hardware/mbed/1.1.2/cores/arduino/mbed/platform/Callback.h:661:9: error: no matching function for call to 'operator new(sizetype, void*&)'
         new (d) F(*(F *)p);
         ^~~~~~~~~~~~~~~~~~
<built-in>: note: candidate: void* operator new(unsigned int)
<built-in>: note:   candidate expects 1 argument, 2 provided
exit status 1
Error compiling for board Arduino Nano 33 BLE.
facchinm commented 5 years ago

Hi @dhalbert , are you sure there is no stray file in the folder where the Blink you are compiling lives? The ./new:1:40: error: string looks suspicious. I'll try on a clean 18.04 VM and will report back

dhalbert commented 5 years ago

@facchinm Hmm, there is a file named new, but it is not in examples/01.Basics/Blink, it's in my home directory (!). It happens to contain some code with hid_report_descriptor. If I rename it to new1, the problem goes away. (There were files labeled new and old I was diff-ing.)

But this is now a different kind of bug. Why should a stray file named new be included in a compilation, and only for Nano 33 BLE? The panel icon I use to start arduino does start it up with my homedir as the current directory.

facchinm commented 5 years ago

Indeed it's very suspicious; paths outside compiler and core folders should never be included... Unless you have something overriding the default paths as environment variable. Could it be the case?

dhalbert commented 5 years ago

I don't see any such env var; perhaps there is some typo in the Mbed build scripts (like a new instead of $new or something). The new is not affecting other board compilations. I'll poke around.

dhalbert commented 5 years ago

.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/functional has these includes:

Note the #include <new>. So somehow . is part of the include path.

#if __cplusplus >= 201103L

#include <new>
#include <tuple>
#include <type_traits>
#include <bits/functional_hash.h>
#include <bits/invoke.h>
#include <bits/std_function.h>
#if __cplusplus > 201402L
# include <unordered_map>
# include <vector>
# include <array>
# include <utility>
# include <bits/stl_algo.h>
#endif
dhalbert commented 5 years ago

For Arduino Nano 33 BLE< note, the -I.:

/home/halbert/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-g++ -c -I. ...

In a vanilla Uno build, there is no -I. as a command-line arg on any of the compilation lines.

dhalbert commented 5 years ago

Sorry for the slew of messages. In .arduino15/packages/arduino/hardware/mbed/1.1.2/platform.txt, there is:

...
compiler.c.flags=-c -I. {compiler.warning_flags} -Os -g -nostdlib "@{compiler.mbed.defines}" "@{compiler.mbed.cflags}" {compiler.mbed.arch.define} -MMD -mcpu={build.mcu}
...
compiler.cpp.flags=-c -I. {compiler.warning_flags} -g -Os -nostdlib "@{compiler.mbed.defines}" "@{compiler.mbed.cxxflags}" {compiler.mbed.arch.define} -MMD -mcpu={build.mcu}
...

No other BSP platform.txt files that I have installed include -I.

facchinm commented 5 years ago

You are TOTALLY right. I don't know when that include path slipped into (it exist since the initial commit). I'm removing it right now; thank you so much for spotting this!