Main.h is not found
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-01-27 4:29 AM - last edited on ‎2025-01-27 4:48 AM by Andrew Neil
Hi,
I generated the code in CubeMX and opened it in VSCode. However, I cannot run the code because VSCode cannot find main.h. I'm not sure why this is happening. I've generated the code twice, but the problem persists. The main.h file is located in the Core > Inc folder, and main.c is in the Core > Src folder. Does anyone know what might be causing this issue? Thanks!
Solved! Go to Solution.
- Labels:
-
VSCode for STM32
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-01-27 4:49 AM - edited ‎2025-01-27 4:51 AM
If it's not finding the headers, that means your Include Paths need fixing - these are what tell the compiler where to find header files.
https://labs.dese.iisc.ac.in/embeddedlab/vscode-include-paths/
A complex system designed from scratch never works and cannot be patched up to make it work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-01-27 4:40 AM
Did you import the project and open the folder? Here are instructions:
How to use VS Code with STM32 microcontrollers - STMicroelectronics Community
hth
KnarfB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-01-27 4:48 AM
Yes, I followed the instructions, but I have the feeling that something might be off with the settings or something else. Is there something I might need to adjust?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-01-27 4:49 AM - edited ‎2025-01-27 4:51 AM
If it's not finding the headers, that means your Include Paths need fixing - these are what tell the compiler where to find header files.
https://labs.dese.iisc.ac.in/embeddedlab/vscode-include-paths/
A complex system designed from scratch never works and cannot be patched up to make it work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-01-27 5:10 AM
Thank you, I'll try it. I hope it works ;)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-01-27 5:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-01-27 5:50 AM - edited ‎2025-01-27 5:51 AM
Does VSCode show you the command lines as it executes them during a build?
Or does it record that in a log file somewhere?
PS:
You haven't said what platform you're on.
If linux, remember that it is case-sensitive ...
A complex system designed from scratch never works and cannot be patched up to make it work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-01-27 11:04 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-01-27 11:22 PM
upload your ioc file
TimerCallback tutorial! | UART and DMA Idle tutorial!
If you find my solution useful, please click the Accept as Solution so others see the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-01-28 6:18 AM
It seems like I've resolved one of the issues by changing some settings in STM32CubeMX. However, the main.c and main.h files are still incorrect. No matter what I change, the files remain problematic. Additionally, I forgot to install STM32CubeCLT, but that hasn’t affected anything else so far. I do not know what i could change that my program works. Does anyone know please explain it to me.
