Compile error for common.h

Hi I am hoping someone can help. I am running at Nano 33 IOT, and trying to compile things with the BLEPeripherals library. When have "BLEPeripherals.h" as an include, I get compile errors with "Common.h". Specifically, I get:

.../Library/Arduino15/packages/arduino/hardware/samd/1.8.14/cores/arduino/api/Common.h:126:12: error: expected unqualified-id before 'const'
auto min(const T& a, const L& b) -> decltype((b < a) ? b : a)

I am not doing any editing on that file, and I thought it should just be a standard library, so I am not sure why it is choking.

I have searched a bit to find out what the issue might be, but no luck.

Any thoughts?

Thanks in advance.

Welcome to the forum

As your topic does not relate directly to the installation or operation of the IDE it has been moved to the Programming category of the forum

Which Arduino board are you using ?

Please post your full sketch, using code tags when you do

I am running a Nano 33 IOT.

Here is the code:

#include<MIDI.h>
#include<SPI.h>
#include<BLEPeripheral.h>

BLEPeripheral blePeripheral;


// MIDI Service UUID 03B80E5A-EDE8-4B33-A751-6CE34EC4C700
// MIDI Characteristic UUID 7772E5DB-3868-4112-A1A9-F2669D106BF3




void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

Here are the error messages:

In file included from /Users/ABC/Documents/Arduino/libraries/BLEPeripheral/src/BLEPeripheral.cpp:6:0:
/Users/ABC/Library/Arduino15/packages/arduino/hardware/samd/1.8.14/cores/arduino/api/Common.h:126:12: error: expected unqualified-id before 'const'
auto min(const T& a, const L& b) -> decltype((b < a) ? b : a)
^
/Users/ABC/Documents/Arduino/libraries/BLEPeripheral/src/BLEDeviceLimits.h:16:21: note: in definition of macro 'min'
#define min(a,b) (((a) < (b)) ? (a) : (b))
^
/Users/ABC/Library/Arduino15/packages/arduino/hardware/samd/1.8.14/cores/arduino/api/Common.h:126:12: error: expected ')' before 'const'
auto min(const T& a, const L& b) -> decltype((b < a) ? b : a)
^
/Users/ABC/Documents/Arduino/libraries/BLEPeripheral/src/BLEDeviceLimits.h:16:21: note: in definition of macro 'min'
#define min(a,b) (((a) < (b)) ? (a) : (b))
^
/Users/ABC/Library/Arduino15/packages/arduino/hardware/samd/1.8.14/cores/arduino/api/Common.h:126:12: error: expected ')' before 'const'
auto min(const T& a, const L& b) -> decltype((b < a) ? b : a)
^
/Users/ABC/Documents/Arduino/libraries/BLEPeripheral/src/BLEDeviceLimits.h:16:21: note: in definition of macro 'min'
#define min(a,b) (((a) < (b)) ? (a) : (b))
^
/Users/ABC/Library/Arduino15/packages/arduino/hardware/samd/1.8.14/cores/arduino/api/Common.h:126:12: error: expected ')' before 'const'
auto min(const T& a, const L& b) -> decltype((b < a) ? b : a)
^
/Users/ABC/Documents/Arduino/libraries/BLEPeripheral/src/BLEDeviceLimits.h:16:21: note: in definition of macro 'min'
#define min(a,b) (((a) < (b)) ? (a) : (b))
^
/Users/ABC/Library/Arduino15/packages/arduino/hardware/samd/1.8.14/cores/arduino/api/Common.h:132:12: error: expected unqualified-id before 'const'
auto max(const T& a, const L& b) -> decltype((b < a) ? b : a)
^
/Users/ABC/Documents/Arduino/libraries/BLEPeripheral/src/BLEDeviceLimits.h:12:21: note: in definition of macro 'max'
#define max(a,b) (((a) > (b)) ? (a) : (b))
^
/Users/ABC/Library/Arduino15/packages/arduino/hardware/samd/1.8.14/cores/arduino/api/Common.h:132:12: error: expected ')' before 'const'
auto max(const T& a, const L& b) -> decltype((b < a) ? b : a)
^
/Users/ABC/Documents/Arduino/libraries/BLEPeripheral/src/BLEDeviceLimits.h:12:21: note: in definition of macro 'max'
#define max(a,b) (((a) > (b)) ? (a) : (b))
^
/Users/ABC/Library/Arduino15/packages/arduino/hardware/samd/1.8.14/cores/arduino/api/Common.h:132:12: error: expected ')' before 'const'
auto max(const T& a, const L& b) -> decltype((b < a) ? b : a)
^
/Users/ABC/Documents/Arduino/libraries/BLEPeripheral/src/BLEDeviceLimits.h:12:21: note: in definition of macro 'max'
#define max(a,b) (((a) > (b)) ? (a) : (b))
^
/Users/ABC/Library/Arduino15/packages/arduino/hardware/samd/1.8.14/cores/arduino/api/Common.h:132:12: error: expected ')' before 'const'
auto max(const T& a, const L& b) -> decltype((b < a) ? b : a)
^
/Users/ABC/Documents/Arduino/libraries/BLEPeripheral/src/BLEDeviceLimits.h:12:21: note: in definition of macro 'max'
#define max(a,b) (((a) > (b)) ? (a) : (b))
^

exit status 1

Compilation error: exit status 1

Has their own definitions for min and max that conflict with Common.h definitions.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.