cancel
Showing results for 
Search instead for 
Did you mean: 

Include paths (-I) stopped working

pav_ivanovs
Associate III

Hi all,

 

Previously, I've been adding all paths with the used header files in the Project->Properties->C/C++ Build->Settings->MCU GCC Compiler->Include paths->Include paths (-I), like this:

pav_ivanovs_0-1742989958331.png

It has been working pretty well, until it just stopped. The last thing that I've tried to add is "${workspace_loc:/${ProjName}/Firmware/MCU/Processor/FPU/FPU_Reg}" path and the compiler doesn't see header files stored there anymore. So, if I write #include "Cortex_M4_FPU_Reg.h" in source files, the build console throws out this error:

pav_ivanovs_1-1742990203356.png

but when I write #include <FPU/FPU_Reg/Cortex_M4_FPU_Reg.h>, everything is ok.

Does anyone know why Include paths (-I) worked previously, but now it stopped accepting new paths?

1 ACCEPTED SOLUTION

Accepted Solutions
KnarfB
Principal III

The detailed console output shows the compile... commands with all and flags including the -I that made it to the command line. You may want to post it here for better analysis.

Hope you have double-checked your file&folder structure, especially for (case sensitive) spelling errors or exotic chars in paths.

It seems to be something custom which I don't recognize.   

hth

KnarfB

 

View solution in original post

5 REPLIES 5
KnarfB
Principal III

The detailed console output shows the compile... commands with all and flags including the -I that made it to the command line. You may want to post it here for better analysis.

Hope you have double-checked your file&folder structure, especially for (case sensitive) spelling errors or exotic chars in paths.

It seems to be something custom which I don't recognize.   

hth

KnarfB

 

Thanks for the suggestion. I've attached the build console log, although it's massive. What I've noticed though is that for some source files, the necessary command (-I"D:/ST/My_Projects/Sensors_To_LEDs_Interface/Firmware/MCU/Processor/FPU/FPU_Reg") is performed, but for the exact source file where the #include "Cortex_M4_FPU_Reg.h" string is located (STM32F303_C_TIM_HAL.c) this command is omitted, so the error occurs. No idea why, though.

pav_ivanovs
Associate III

Ok, I've solved the issue, but I have a related question on how these Include paths (-I) are supposed to work. So, as I said, I configured them previously for the whole project by clicking Project->Properties->C/C++ Build->Settings->MCU GCC Compiler->Include paths->Include paths (-I).

But now, what fixed the error is configuring Include paths (-I) for the "Firmware" folder within the project specifically, so "Firmware folder"->Properties->C/C++ Build->Settings->MCU GCC Compiler->Include paths->Include paths (-I).

I don't understand, why Firmware folder has a different Include paths (-I) configuration from the Project.

Great. Generally, these settings apply hierarchically. You may adjust them for individual files as well.

hth

KnarfB

Try using ${ProjDirPath}/... instead of  ${workspace_loc:/${ProjName}/... }

Eclipse is so complicated ((