4 years, 11 months ago.

#Include difficulties in Mbed Studio

Hi,

I am currently having issues with #include directives in Mbed Studio not being recognized. My program tries to include a header file stored in a folder in the same project folder. Studio only recognizes the header file when it is placed in the exact same folder. This problem is not unique for this particular header file and happens in many projects which can be successfully compiled in other programs.

3 Answers

4 years, 9 months ago.

Hi Guillaume,

Can you send us the example program and target you can reproduce this issue on? Does this issue only appear in C/C++ intellisense or also during compilation? In Mbed Studio 0.5.1 we added support to Clangd 8.0.0. It improved the support for #include directives. Can you recheck this issue in the latest release of Mbed Studio?

Regards - Arek

Accepted Answer

The trouble with #include would occur in intellisense and in compilation. This problem only occurred when I imported projects from the MBed community using MBed Studios' functionality. It didn't matter what was imported, I always had difficulties using the import function. I've since found that if I import code using the CLI into my MBed programs directory, I could use Studio normally.

posted by Guillaume Raymond-Fauteux 04 Jul 2019
4 years, 11 months ago.

This problem was introduced about a year ago. This used to work perfectly until the compiler was upgraded. I filed the same complaint and no one at Mbed cared. It should work as you describe but I ended up having to add the "path" to each include file. Part of the downfall of mbed as a whole...

4 years, 11 months ago.

Hi Guillaume,

Thanks for reporting this.

Do you mean Mbed Studio, or the Online Compiler as suggested by Bill? We'll investigate either way.

Thanks, Joe

Libraries work fine in the online compiler as far as I have worked with them, Mbed Studio is what I'm having the most trouble with.

posted by Guillaume Raymond-Fauteux 10 May 2019