cancel
Showing results for 
Search instead for 
Did you mean: 

Include files help.

ubaldot
Senior

I have a source folder named components where each subfolder has a .c and a .h file, see screenshot below.

I am trying to include these files, but they cannot be found. So far, I know that I should add the relative path and so I did. (I also tried to replace the ../ with the ./ in the #include). 

How to solve? 

ubaldot_0-1706174213811.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
ubaldot
Senior

Solution:

 

Project -> Properties -> C/C++ Build -> Settings -> MCU GCC Compiler -> Include paths and I added ../components

At this point, I can include the headers inside the components folder with e.g.

 

#include "blink/blink_main.h" 

 

 

 

View solution in original post

2 REPLIES 2
ubaldot
Senior

Solution:

 

Project -> Properties -> C/C++ Build -> Settings -> MCU GCC Compiler -> Include paths and I added ../components

At this point, I can include the headers inside the components folder with e.g.

 

#include "blink/blink_main.h" 

 

 

 

Note that you can also specify a folder as an Include Path by right-clicking in the Project Explorer:

https://community.st.com/t5/stm32cubeide-mcus/cmsis-dsp-and-stm32cubeide/m-p/630989/highlight/true#M23664

AndrewNeil_0-1706179013652.png