2024-08-07 03:04 PM - edited 2024-08-07 03:09 PM
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
Solved! Go to Solution.
2024-08-07 03:20 PM
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
2024-08-07 03:20 PM
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
2024-08-07 03:34 PM
Full path is
C:\mvt1\Drivers\STM32H7xx_HAL_Driver\Inc\Legacy
I added
#include "Legacy\stm32_hal_legacy.h"
It worked!
Thanks