cancel
Showing results for 
Search instead for 
Did you mean: 

Missing header file error...

iDeew
Associate II

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

 

1 ACCEPTED SOLUTION

Accepted Solutions

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

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

2 REPLIES 2

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

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Full path is

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

I added 

#include "Legacy\stm32_hal_legacy.h"

It worked!

Thanks