Arm Mbed and Pelion Device Management support forum

Compile include order mbed-os versus mbed 2

I got a number of problems when migrating from mbed2 to mbed-os with the offline Compiler (on Mac):

1) Case sensitivity
I have a local project file called “PinMap.h” which was working fine with mbed2. With mbed-os the compiler task mixes this up my PinMap.h file with the in "mbed-os/hal/pinmap.h

The only way to overcome this was to create a Mac case sensitive file system.

2) Include/Compiler Order
I have local copies (in a library) of USBCDC.h, USBHID.h, USBHID.cpp etc.

Now the compiler includes the system header and sources of USBCDC.h/cpp instead of my local library.

This all was working fine with mbed2, with mbed-os it does not work.

Is there any chance to get the compile order right? (without renaming all files)

mbed --version says 1.10.2

Thank you, Helmut


your post topic to ‘Online compiler’ section and inside you write about a nonspecific offline Compiler. So you mean Mbed Cli? :slight_smile:
Just tips:
Maybe it is a different problem but my colleague had also problems with including of header files.
Some problems were solved by change this #include <yourheader.h> to #include "yourheader.h", according to this topic
Another problem was when .h and .cpp files were placed in a folder and that was solved by #include "../yourheader.h" or #include "yourfolder/yourheader.h".

Br, Jan

Hi Br, Jan, thank you for your tip, however I the “” include quotes, at present the workaround is to use a case sensitive file system. At present I don’t know the source of the problem (compiler or mbed build failure). I looked into the @ includes for the headers and the linker and cannot see the problem.
Regards Helmut