Skip to main content
Associate
August 5, 2024
Solved

Actual Include paths do not correspond to Include Paths in the settings

  • August 5, 2024
  • 4 replies
  • 3494 views

Hello, I am trying to add source files in my project, the folder is organized like this : 
- events :
     |  - include :
     |      |  - events :
     |      |      |  - internal :
     |      |      |      |  - Some header files [A]
     |      |      |  - Some other header files [B]
     |  - source :
     |      |  -  .c and .cpp files

I copied the same path list to GCC asm, GCC compiler, G++ compiler :

Toin_0-1722897384992.png

 

When compiling i get "include not found" errors, i think it fails when including "folder/header.h" instead of just "header.h", but I am not certain.

arm-none-eabi-g++ "../mbed-os/events/source/mbed_shared_queues.cpp" -mcpu=cortex-m4 -std=gnu++17 -g3 -DDEVICE_MPU=1 -DCONFIG_BAT_24V_LIION -DHW_ID=3 -DDEBUG -DDEVICE_SPI_ASYNCH=1 -DDEVICE_SERIAL=1 -DTARGET_MCU_STM32 -DDEVICE_I2CSLAVE=1 -DTARGET_RTOS_M4_M7 -DTARGET_STM32L4 -DTARGET_MCU_STM32L4 -DSTM32L476xx -DDEVICE_WATCHDOG=1 -DDEVICE_ANALOGOUT=1 -DDEVICE_PORTIN=1 -DTARGET_CORTEX_M -D__MBED_CMSIS_RTOS_CM -DTARGET_RELEASE '-DMBED_BUILD_TIMESTAMP=1619638077.1227326' -DUSE_FULL_LL_DRIVER -DDEVICE_INTERRUPTIN=1 -DTOOLCHAIN_GCC_ARM -DDEVICE_SERIAL_FC=1 -DTRANSACTION_QUEUE_SIZE_SPI=2 -DTARGET_STM -DDEVICE_I2C_ASYNCH=1 -DDEVICE_USTICKER=1 -DDEVICE_CRC=1 -DTOOLCHAIN_GCC -DMBED_TICKLESS -DDEVICE_PWMOUT=1 -DDEVICE_I2C=1 -DTARGET_NUCLEO_L476RG -DTARGET_NUCLEO_L476RG -DARM_MATH_CM4 -D__MBED__=1 -DUSE_HAL_DRIVER -DDEVICE_RTC=1 -DDEVICE_SPI=1 -D__CORTEX_M4 -DDEVICE_RESET_REASON=1 -DTARGET_CORTEX -D__FPU_PRESENT=1 -DDEVICE_FLASH=1 -D__CMSIS_RTOS -DTARGET_M4 -DEXTRA_IDLE_STACK_REQUIRED -DTARGET_STM32L476xG -DDEVICE_PORTINOUT=1 -DDEVICE_PORTOUT=1 -DDEVICE_ANALOGIN=1 -DDEVICE_LPTICKER=1 -DTARGET_MCU_STM32L476xG -DDEVICE_TRNG=1 -DDEVICE_STDIO_MESSAGES=1 -DTARGET_LIKE_MBED -DDEVICE_CAN=1 -DDEVICE_SPISLAVE=1 -DDEVICE_SERIAL_ASYNCH=1 -DTARGET_LIKE_CORTEX_M4 -DTARGET_NAME=NUCLEO_L476RG -DDEVICE_SLEEP=1 -DMBED_DEBUG -DMBED_TRAP_ERRORS_ENABLED=1 -DMBED_RTOS_SINGLE_THREAD -D__NEWLIB_NANO -DMBED_MINIMAL_PRINTF -DNDEBUG -c -includeC:/Users/antoi/Desktop/repos/firmware_cmd_stm32l432kc/mbed_config.h -O2 -ffunction-sections -fdata-sections -fno-exceptions -fno-rtti -fno-use-cxa-atexit -Wall -Wextra -funsigned-char -fomit-frame-pointer -c -g3 -Wvla -Wno-unused-parameter -Wno-missing-field-initializers -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"mbed-os/events/source/mbed_shared_queues.d" -MT"mbed-os/events/source/mbed_shared_queues.o" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -mthumb -o "mbed-os/events/source/mbed_shared_queues.o" @"mbed-os/events/source/EventQueue.cpp_includes.args"
../mbed-os/events/source/EventQueue.cpp:17:10: fatal error: events/EventQueue.h: No such file or directory
 17 | #include "events/EventQueue.h"
 | ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [mbed-os/events/source/subdir.mk:35: mbed-os/events/source/EventQueue.o] Error 1
make[1]: *** Waiting for unfinished jobs....
../mbed-os/events/source/equeue.c:19:10: fatal error: events/equeue.h: No such file or directory
 19 | #include "events/equeue.h"
 | ^~~~~~~~~~~~~~~~~

 
I noticed that at the end of the compile command, there is this file mentioned :
"mbed-os/events/source/EventQueue.cpp_includes.args"

This file contains a list of inclusion arguments which look like what I'm including in the project properties, but the "events" folder is missing.
It is being refreshed at every compilation because if i modify it, it goes back to the initial state

I also added a "TEST" folder and added it to the included paths, and it does not appear either

What am I missing to give the compiler the correct paths ?

Thanks in advance

    This topic has been closed for replies.
    Best answer by Toin

    Found the problem... 
    For some reason, the events folder had specific build settings
    I found them by right-click on "events" --> properties, It had an old version of the project include paths
    Is there a toggle for folder specific settings ? 
    I must have enabled them unknowingly :\

    4 replies

    ToinAuthor
    Associate
    August 6, 2024

    Update : Some cpp files at the root of the project DO get the updated cpp_includes.args, but the source files in "events" do not

    Andrew Neil
    Super User
    August 6, 2024

    That could also be a result of relative paths ...

    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    Andrew Neil
    Super User
    August 6, 2024

    @Toin wrote:

    - events :
         |  - include :
         |      |  - events :
         |      |      |  - internal :
         |      |      |      |  - Some header files [A]
         |      |      |  - Some other header files [B]
         |  - source :
         |      |  -  .c and .cpp files


    For ASCII Art to work, it must be in a mono-spaced font - so use the </> source code button.

     


    @Toin wrote:

    i think it fails when including "folder/header.h" instead of just "header.h",


    Yes, that's always the trouble with relative paths - you have to be sure what it's relative to !

    Hence best to stick to just the "header.h" form, and be sure to add the folder to the paths.

     

     

     

    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    ToinAuthorBest answer
    Associate
    August 6, 2024

    Found the problem... 
    For some reason, the events folder had specific build settings
    I found them by right-click on "events" --> properties, It had an old version of the project include paths
    Is there a toggle for folder specific settings ? 
    I must have enabled them unknowingly :\