2020-05-20 03:26 AM
This is an issue i currently have with two differents project. After importing an error free project, the IDE have issue linking included files.
When building i have "fatal error: FLASH_G0.h: No such file or directory" on the #include "foo.h" line, as if the .h weren't there.
But the file are there, and when i press F3 over the foo.h, the IDE open foo.h without any issue, proving the files are there and the IDE know where they are.
But i still have the error when building.
I tried the following things:
-refresh the project
-rebuild index & freshen all files
-remove the .h, refresh, put back the .h, refresh
-remove & import again the project.
Nothing fixed it and i'm running out of idea to try fixing the issue.
Solved! Go to Solution.
2020-05-20 05:49 AM
Ensure the directory of the header file is listed in your include paths for the compiler.
right click project -> Properties -> C/C++ Build -> Settings -> Tool Settings -> MCU GCC Compiler -> Include paths
2020-05-20 05:49 AM
Ensure the directory of the header file is listed in your include paths for the compiler.
right click project -> Properties -> C/C++ Build -> Settings -> Tool Settings -> MCU GCC Compiler -> Include paths
2020-05-21 11:10 PM
That was my issue... I feel stupid.
Thanks you for your answer!
2022-09-02 01:16 AM
Sorry to bring this thread up again. If I want to add new header file to one of the Include paths, how can I update that path to display the new added header files?
Right now, I added new header files in Core/Inc (not shown in Project Explorer) but when I expand Core/Inc, the new added header files are not there.
2022-09-02 06:09 AM
2022-09-02 01:53 PM
Hello, thank you for your response. I did that already but nothing was updated. This was one of the thing I did: Via File Explorer at the Core/Inc, I created a file called testing.h. Then, although I refreshed the Project Explorer tab many times, there was no testing.h in the red area.
2022-09-02 05:07 PM
2022-09-04 01:00 AM
I am sorry. I looked at a wrong direction. That is why I could not find my newly created files. Thank you very much for your response.
2023-04-24 05:29 AM - edited 2023-11-20 09:24 AM
Hi, I'm having a similar problem. When compiling, I have errors saying that header files do not exist. The project is a simple PWM on a LED. The include paths are configured. I cleaned the project, workspace, etc and restarted everything but the errors are still there. Any idea on how to solve this problem?
Example:
.../Middlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_core.c:22:10: fatal error: usbh_core.h: No such file or directory
22 | #include "usbh_core.h"
| ^~~~~~~~~~~~~
usbh_core.h is in /Middlewares/ST/STM32_USB_Host_Library/Core/Inc which is a configured path (see screenshot)
P-S: F3 does work so the IDE recognises the files.