5 years, 5 months ago.

Compiling in C++11 mode under GCC?


Is it possible to compile programs in C++11 mode with ARM_GCC under mbed 5.1? If yes, how should I setup the project so that the right option is passed to GCC?

Also, In general, what is the best way to pass specific compiler options to GCC under mbed 5.1?

1 Answer

5 years, 5 months ago.

No C++11 support on mbed OS at the moment. I've been told it's because we need to be able to compile with ARMCC, GCC and IAR.

Update (2018): C++11 can be enabled through a custom build profile. Unfortunately not in the Online Compiler at this point.

Thanks Jan. I am aware that the mbed OS is stuck at C++03 for the moment but my question is how we can compile an application in the c++11 mode. If I manually edit the mbed-os/tools/gcc.py and add the "std=c++11" the build seems to work fine but surely there must be a better way to change or override compiler flags. Btw, the "options" command to mbed-cli is not the answer as it does something very different.

posted by Alef Sin 10 Aug 2016

Ah, my bad. I was under the assumption we already merged this feature, and figured was renamed to options... We'll be tracking this feature in https://github.com/ARMmbed/mbed-os/issues/2001.

posted by Jan Jongboom 10 Aug 2016

Thanks for clarification Jan. Hopefully this issue gets resolved soon.

posted by Alef Sin 10 Aug 2016