2025-01-27 04:29 AM - last edited on 2025-01-27 04: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.
2025-01-27 04:49 AM - edited 2025-01-27 04: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/
2025-01-27 04: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
2025-01-27 04: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?
2025-01-27 04:49 AM - edited 2025-01-27 04: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/
2025-01-27 05:10 AM
Thank you, I'll try it. I hope it works ;)
2025-01-27 05:42 AM
2025-01-27 05:50 AM - edited 2025-01-27 05: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 ...
2025-01-27 11:04 PM
2025-01-27 11:22 PM
upload your ioc file
2025-01-28 06: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.