Skip to main content
Visitor II
August 7, 2024
Solved

Missing header file error...

  • August 7, 2024
  • 1 reply
  • 2195 views

Hi,
I am relatively new to STM32 development and would greatly appreciate any assistance with the following issue.

I am encountering the following compile-time error:

 

C:/mvt1/TouchGFX/gui/src/settingsa_screen/SettingsAView.cpp:7:10: fatal error: ..\Drivers\STM32H7xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h: No such file or directory
 7 | #include <..\Drivers\STM32H7xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h>
 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

 

I have added the necessary path to my project settings, and the file stm32_hal_legacy.h is present in the specified folder. Despite this, the IDE is unable to locate the file. Could you please provide guidance on why this issue might be occurring?
Thanks

 

    This topic has been closed for replies.
    Best answer by Tesla DeLorean

    They are different directories.

    The one in the paths probably isn't relative to the starting point, what's the actual, full path?

    If the compiler can't concatenate what you've provided into a real path and a real file, it's going to fail.

    Typically you'd put the "..\Drivers\STM32H7xx_HAL_Driver\Inc" in the Paths, if that's the right starting point, and then

    #include <Legacy\stm32_hal_legacy.h>

    Or use it from another #include file whose directory has already been established

    #include "Legacy\stm32_hal_legacy.h"

    Say from "..\Drivers\STM32H7xx_HAL_Driver\Inc\stm32h7xx_hal_def.h".

     

    Try to make things as minimally repetitive and minimally convoluted as possible

    1 reply

    Graduate II
    August 7, 2024

    They are different directories.

    The one in the paths probably isn't relative to the starting point, what's the actual, full path?

    If the compiler can't concatenate what you've provided into a real path and a real file, it's going to fail.

    Typically you'd put the "..\Drivers\STM32H7xx_HAL_Driver\Inc" in the Paths, if that's the right starting point, and then

    #include <Legacy\stm32_hal_legacy.h>

    Or use it from another #include file whose directory has already been established

    #include "Legacy\stm32_hal_legacy.h"

    Say from "..\Drivers\STM32H7xx_HAL_Driver\Inc\stm32h7xx_hal_def.h".

     

    Try to make things as minimally repetitive and minimally convoluted as possible

    iDeewAuthor
    Visitor II
    August 7, 2024

    Full path is

    C:\mvt1\Drivers\STM32H7xx_HAL_Driver\Inc\Legacy

    I added 

    #include "Legacy\stm32_hal_legacy.h"

    It worked!

    Thanks