2025-01-09 05:52 AM
Hello!
One problem I had today:
I made a new project for one specific question.
In the process of doing this, I created a file. Let's call it test.c / test.h using STM32CubeIDE, V1.7, Linux.
To start from the beginning, I added a source folder, and created a h file and c file in this folder (test.c / .h)
I added include "test.h" in main. The compiler doesn't' find test.h.
Is there anything else to do? The folder I created has a small C in its icon, which indicates it's recognized
as a source folder, so I don't get it...
Thanks for any hint!
PG
2025-01-09 06:55 AM
To have it find test.h when you #include it, add the folder to the include directories in project properties:
To add a folder with source code that it needs to compile, add that folder in the "Source Location" tab shown in the screenshot.
2025-01-09 07:57 AM
Can be many reasons. But anybody would need more info to help you.
A) you have an STM32CubeIde project AAA created with STM32CubeIde - correct?
B) than you have a tree structure, a main.c file in some src directory - correct?
C) you have added to src directory some files, test. c and test .h - ok?
D) IDE indexes files - use command refresh.
E) now you must say to compiler where .h file are - go to properties, compiler, include files dir and add src directory. - solved?
For your reference:
I strongly suggest to include step by step description on how you got to critical point - if eveybody is able to recreate from SCRATCH (this is vital) the problem somebody could help you:
1) describe the steps you did, one by one;
2) try yourself to replicate the problem executing your steps one by one