2 months, 4 weeks ago.

Include Local files without copying them under mbed project structure


I am trying share my .c/.h files across multiple projects. The other projects are not mbed projects.

Following is the structure I want, but the compiler cant find the Directory1/Directory2 unless I use ../../../Include option. Even then, I will end up with errors as the include files in Directory1 also locally include some more files (shown below) /https:/os.mbed.com/media/uploads/nileshbadodekar/failing.png

What Does work however is if i simply copy the Directory1/2 under MBED folder (shown below) /https:/os.mbed.com/media/uploads/nileshbadodekar/working.png

Everything compiles smoothly in this situation, but it means I have to keep duplicate copies of same files which I want to avoid.

Is there any way in MBED Studio (0.7.0) that i can tell the compiler to source the appropriate headers/c files?


1 Answer

2 months, 4 weeks ago.

Hi Nilesh,

Unfortunately all Mbed OS project files must be inside the project folder.

Regards, Pekka

Hi Pekka Thank you for your reply.

In mbed-cli, there are compiler options that (potentially) can allow me to source/include different files.

Is that not true/possible?

Regards, Nilesh

posted by Nilesh Badodekar 21 Nov 2019