Skip to content

Compilation fails on Arduino Due #16

@obdevel

Description

@obdevel

I get compilation errors when compiling for an Arduino Due board. e.g. the StreamingTests sketch:

/Applications/Arduino.app/Contents/Java/arduino-builder -compile -logger=machine -hardware /Applications/Arduino.app/Contents/Java/hardware -hardware /Users/xxx/Library/Arduino15/packages -hardware /Users/xxx/Documents/Arduino/hardware -tools /Applications/Arduino.app/Contents/Java/tools-builder -tools /Applications/Arduino.app/Contents/Java/hardware/tools/avr -tools /Users/xxx/Library/Arduino15/packages -built-in-libraries /Applications/Arduino.app/Contents/Java/libraries -libraries /Users/xxx/Documents/Arduino/libraries -fqbn=arduino:sam:arduino_due_x -vid-pid=0000_0000 -ide-version=10813 -build-path /var/folders/03/s3pv8qk91w78m4_st_nbxl5m0000gn/T/arduino_build_207807 -warnings=all -build-cache /var/folders/03/s3pv8qk91w78m4_st_nbxl5m0000gn/T/arduino_cache_90353 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.bossac.path=/Users/xxx/Library/Arduino15/packages/arduino/tools/bossac/1.6.1-arduino -prefs=runtime.tools.bossac-1.6.1-arduino.path=/Users/xxx/Library/Arduino15/packages/arduino/tools/bossac/1.6.1-arduino -prefs=runtime.tools.arm-none-eabi-gcc.path=/Users/xxx/Library/Arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1 -prefs=runtime.tools.arm-none-eabi-gcc-4.8.3-2014q1.path=/Users/xxx/Library/Arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1 -verbose /Users/xxx/Documents/Arduino/libraries/Streaming/examples/StreamingTests/StreamingTests.ino
Using board 'arduino_due_x' from platform in folder: /Users/xxx/Library/Arduino15/packages/arduino/hardware/sam/1.6.12
Using core 'arduino' from platform in folder: /Users/xxx/Library/Arduino15/packages/arduino/hardware/sam/1.6.12
Detecting libraries used...
/Users/xxx/Library/Arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-g++ -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -mcpu=cortex-m3 -mthumb -DF_CPU=84000000L -DARDUINO=10813 -DARDUINO_SAM_DUE -DARDUINO_ARCH_SAM -D__SAM3X8E__ -mthumb -DUSB_VID=0x2341 -DUSB_PID=0x003e -DUSBCON "-DUSB_MANUFACTURER=\"Arduino LLC\"" "-DUSB_PRODUCT=\"Arduino Due\"" -I/Users/xxx/Library/Arduino15/packages/arduino/hardware/sam/1.6.12/system/libsam -I/Users/xxx/Library/Arduino15/packages/arduino/hardware/sam/1.6.12/system/CMSIS/CMSIS/Include/ -I/Users/xxx/Library/Arduino15/packages/arduino/hardware/sam/1.6.12/system/CMSIS/Device/ATMEL/ -I/Users/xxx/Library/Arduino15/packages/arduino/hardware/sam/1.6.12/cores/arduino -I/Users/xxx/Library/Arduino15/packages/arduino/hardware/sam/1.6.12/variants/arduino_due_x /var/folders/03/s3pv8qk91w78m4_st_nbxl5m0000gn/T/arduino_build_207807/sketch/StreamingTests.ino.cpp -o /dev/null -DARDUINO_LIB_DISCOVERY_PHASE
Alternatives for Streaming.h: [Streaming@6.0.8]
ResolveLibrary(Streaming.h)
  -> candidates: [Streaming@6.0.8]
/Users/xxx/Library/Arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-g++ -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -mcpu=cortex-m3 -mthumb -DF_CPU=84000000L -DARDUINO=10813 -DARDUINO_SAM_DUE -DARDUINO_ARCH_SAM -D__SAM3X8E__ -mthumb -DUSB_VID=0x2341 -DUSB_PID=0x003e -DUSBCON "-DUSB_MANUFACTURER=\"Arduino LLC\"" "-DUSB_PRODUCT=\"Arduino Due\"" -I/Users/xxx/Library/Arduino15/packages/arduino/hardware/sam/1.6.12/system/libsam -I/Users/xxx/Library/Arduino15/packages/arduino/hardware/sam/1.6.12/system/CMSIS/CMSIS/Include/ -I/Users/xxx/Library/Arduino15/packages/arduino/hardware/sam/1.6.12/system/CMSIS/Device/ATMEL/ -I/Users/xxx/Library/Arduino15/packages/arduino/hardware/sam/1.6.12/cores/arduino -I/Users/xxx/Library/Arduino15/packages/arduino/hardware/sam/1.6.12/variants/arduino_due_x -I/Users/xxx/Documents/Arduino/libraries/Streaming/src /var/folders/03/s3pv8qk91w78m4_st_nbxl5m0000gn/T/arduino_build_207807/sketch/StreamingTests.ino.cpp -o /dev/null -DARDUINO_LIB_DISCOVERY_PHASE
Generating function prototypes...
/Users/xxx/Library/Arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-g++ -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -mcpu=cortex-m3 -mthumb -DF_CPU=84000000L -DARDUINO=10813 -DARDUINO_SAM_DUE -DARDUINO_ARCH_SAM -D__SAM3X8E__ -mthumb -DUSB_VID=0x2341 -DUSB_PID=0x003e -DUSBCON "-DUSB_MANUFACTURER=\"Arduino LLC\"" "-DUSB_PRODUCT=\"Arduino Due\"" -I/Users/xxx/Library/Arduino15/packages/arduino/hardware/sam/1.6.12/system/libsam -I/Users/xxx/Library/Arduino15/packages/arduino/hardware/sam/1.6.12/system/CMSIS/CMSIS/Include/ -I/Users/xxx/Library/Arduino15/packages/arduino/hardware/sam/1.6.12/system/CMSIS/Device/ATMEL/ -I/Users/xxx/Library/Arduino15/packages/arduino/hardware/sam/1.6.12/cores/arduino -I/Users/xxx/Library/Arduino15/packages/arduino/hardware/sam/1.6.12/variants/arduino_due_x -I/Users/xxx/Documents/Arduino/libraries/Streaming/src /var/folders/03/s3pv8qk91w78m4_st_nbxl5m0000gn/T/arduino_build_207807/sketch/StreamingTests.ino.cpp -o /var/folders/03/s3pv8qk91w78m4_st_nbxl5m0000gn/T/arduino_build_207807/preproc/ctags_target_for_gcc_minus_e.cpp -DARDUINO_LIB_DISCOVERY_PHASE
/Applications/Arduino.app/Contents/Java/tools-builder/ctags/5.8-arduino11/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives /var/folders/03/s3pv8qk91w78m4_st_nbxl5m0000gn/T/arduino_build_207807/preproc/ctags_target_for_gcc_minus_e.cpp
Compiling sketch...
/Users/xxx/Library/Arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-g++ -c -g -Os -Wall -Wextra -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -MMD -mcpu=cortex-m3 -mthumb -DF_CPU=84000000L -DARDUINO=10813 -DARDUINO_SAM_DUE -DARDUINO_ARCH_SAM -D__SAM3X8E__ -mthumb -DUSB_VID=0x2341 -DUSB_PID=0x003e -DUSBCON "-DUSB_MANUFACTURER=\"Arduino LLC\"" "-DUSB_PRODUCT=\"Arduino Due\"" -I/Users/xxx/Library/Arduino15/packages/arduino/hardware/sam/1.6.12/system/libsam -I/Users/xxx/Library/Arduino15/packages/arduino/hardware/sam/1.6.12/system/CMSIS/CMSIS/Include/ -I/Users/xxx/Library/Arduino15/packages/arduino/hardware/sam/1.6.12/system/CMSIS/Device/ATMEL/ -I/Users/xxx/Library/Arduino15/packages/arduino/hardware/sam/1.6.12/cores/arduino -I/Users/xxx/Library/Arduino15/packages/arduino/hardware/sam/1.6.12/variants/arduino_due_x -I/Users/xxx/Documents/Arduino/libraries/Streaming/src /var/folders/03/s3pv8qk91w78m4_st_nbxl5m0000gn/T/arduino_build_207807/sketch/StreamingTests.ino.cpp -o /var/folders/03/s3pv8qk91w78m4_st_nbxl5m0000gn/T/arduino_build_207807/sketch/StreamingTests.ino.cpp.o
In file included from /Users/xxx/Documents/Arduino/libraries/Streaming/examples/StreamingTests/StreamingTests.ino:1:0:
/Users/xxx/Documents/Arduino/libraries/Streaming/src/Streaming.h: In member function 'size_t PrintBuffer<N>::write(const uint8_t*, size_t)':
/Users/xxx/Documents/Arduino/libraries/Streaming/src/Streaming.h:90:35: error: there are no arguments to 'min' that depend on a template parameter, so a declaration of 'min' must be available [-fpermissive]
     size_t s = min(size, N-1 - pos); // need a /0 left
                                   ^
/Users/xxx/Documents/Arduino/libraries/Streaming/src/Streaming.h:90:35: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
/Users/xxx/Documents/Arduino/libraries/Streaming/src/Streaming.h: In instantiation of 'size_t PrintBuffer<N>::write(const uint8_t*, size_t) [with unsigned int N = 32u; size_t = unsigned int; uint8_t = unsigned char]':
/Users/xxx/Documents/Arduino/libraries/Streaming/examples/StreamingTests/StreamingTests.ino:277:1:   required from here
/Users/xxx/Documents/Arduino/libraries/Streaming/src/Streaming.h:90:35: error: 'min' was not declared in this scope
Using library Streaming at version 6.0.8 in folder: /Users/xxx/Documents/Arduino/libraries/Streaming 
exit status 1
Error compiling for board Arduino Due (Native USB Port).

You don't need the Due hardware to reproduce this; just install the "Arduino (ARM) 32-bits Boards" core from the Boards Manager.

Thanks !

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions