Skip to main content
Associate II
March 26, 2025
Solved

Include paths (-I) stopped working

  • March 26, 2025
  • 2 replies
  • 804 views

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?

Best answer by KnarfB

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

 

2 replies

KnarfB
KnarfBBest answer
Super User
March 26, 2025

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

 

Associate II
March 26, 2025

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.

Associate II
March 26, 2025

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.

KnarfB
Super User
March 26, 2025

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

hth

KnarfB