Arm Mbed and Pelion Device Management support forum

How can my library detect when it is being compiled using the mbed [online] compiler?

I test imported one of my libraries from github, which went fine, but I would like to configure it for MBED CLI/ MBED online compiler, so that it works straight away without modifications. (Meanwhile I had to create a #define MBED_ONLINE_COMPILER and put that in a config.h file to configure my library)

I would like for example to disable exceptions and RTTI automatically when using mbed online compiler. Is there a define that can be used to detect that I am compiling under MBED CLI/ MBED online compiler

e.g like _linux_ _WIN32 etc ?


Hello Andy,

I think generally you can test for __MBED__ .
If you’d like to know which version
could be handy. For more details have a look at “mbed-os\platform\mbed_version.h

1 Like