Changing/Finding Out The C++ Compiler Version

Dear Forum,

I'm running the Arduino IDE 1.8.9 (directly downloaded from the arduino.cc download site) on my Debian Linux and I'm having a problem:

For my project I'd like to use the ArduinoHttpServer library but I fail to compile my project and I'm getting error messages like this one:

HttpClientConnection.cpp:21:10: error: 'Method' is not a member of 'ArduinoHttpServer'

That leads me to this site:

Here it's being claimed that I need to make sure that I compile my project using C++ version 11 (or greater?) but I don't know how to find out which compiler version is being used at all.

How can I have the Arduino IDE (1.8.9) use a different compiler version?

Thanks a million in advance and best wishes!
Thomas

It's not really accurate to associate a compiler version with the Arduino IDE version. Different hardware cores use different compiler versions. If you have Tools > Board > Arduino/Genuino Uno selected, you will be using a different compiler than if you have Tools > Board > Arduino MKR Zero selected. It is true that the Arduino comes with a bundled copy of Arduino AVR Boards hardware core and the avr-gcc compiler as part of that core's toolchain, but Boards Manager (Tools > Board > Boards Manager) allows you to install any version of Arduino AVR Boards with any version of the Arduino IDE.

You also need to understand that the normal compiler versions we think of (e.g., avr-gcc 5.4.0-atmel3.6.1-arduino2) is different from the C++ standards version like C++11 that you're referring to. Most of the compilers used by Arduino boards have been using C++11 for a long time. The only exception I can think of are the abandoned Intel x86 boards, which are still using the C++98 standard.

You can determine which C++ standard is in use for you board by uploading this sketch and then opening Serial Monitor at 9600 baud:

void setup() {
  Serial.begin(9600);
  while(!Serial){}
  Serial.println(__cplusplus);
}

void loop() {}

From https://gcc.gnu.org/onlinedocs/cpp/Standard-Predefined-Macros.html:

__cplusplus

This macro is defined when the C++ compiler is in use. You can use __cplusplus to test whether a header is compiled by a C compiler or a C++ compiler. This macro is similar to STDC_VERSION, in that it expands to a version number. Depending on the language standard selected, the value of the macro is 199711L for the 1998 C++ standard, 201103L for the 2011 C++ standard, 201402L for the 2014 C++ standard, 201703L for the 2017 C++ standard, or an unspecified value strictly larger than 201703L for the experimental languages enabled by -std=c++2a and -std=gnu++2a.

You may be able to change the C++ standard in use by editing platform.txt and changing the value of the -std compiler flag, but you can't set it to a newer standard version than is supported by the compiler version in use.