Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years, 4 months ago.
How to set include search paths and #defines to be used by the mbed.org compiler?
If I have a program that has #ifdefs how can I tell the mbed.org compiler what #define to use (eg., equivalent of the -D gcc option)?
Also, what is the equivalent of the -I gcc option, to specify include search paths?
1 Answer
10 years, 4 months ago.
These options are not exposed when using the online IDE. You'd need to create a *.inc file and use in source as appropriate.
test.inc
#define LABEL 3
main.cpp
#include "test.inc" #if LABEL == 1 #error LABEL is 1 #else #warning LABEL is not 1 #endif