Build/include precedence?

I’m compiling a custom library which has a folder “src/fact” and a file “math.h”. Project directory structure is:

/src/lib/mbed-os/(all mbed os goodies)

mbed CLI is picking this (my math.h) up in its mbed OS events lib #include of <math.h> instead of the system one and erroring out.

I’d like mbed CLI to only find my own lib if “fact/math.h” is specified. Is this possible?

Good question… If you run mbed compile -v you can see the includes path (e.g. ./BUILD/disco_f769ni/GCC_ARM/.includes_375c138916cf9dfd2c73b8722800d319.txt). Moving the fact folder all the way back would help.

But I’m not sure if we have a ‘nice’ way of doing this, other than running g++ and ld yourself.

Yeah, you can take Jan’s advice OR rename the function inside your math.h such that it does not conflict with the std math library’s. Then it will definitely pick it up. Additionally, this is a compiler problem, not mbed-cli :smiley: Though, mbed-cli will invoke the compiler for you.