Skip to main content
Associate II
July 25, 2024
Solved

STM32Cube project, how does a file (source or header) containing only a path work?

  • July 25, 2024
  • 2 replies
  • 1022 views

For example there would be a file called "common.h" containing a single line no #include or anything:

../../../Common/Inc/common.h
And in that path there is also a common.h containing the actual C code.
 
The STM32Cube project structure is something like this with App1 and App2 being project folders so it is being used to link to common files.
- Common/
---- Inc
-------- common.h
- App1/
---- Core
-------- Inc
------------ common.h
- App2/
---- Core
-------- Inc
------------ common.h
 
It works so what I would love to know is how it works and what makes it work especially? Is it cube? If so, what in cube is it? How can I reproduce it?

Grateful for any insight!
Oscar
This topic has been closed for replies.
Best answer by Pavel A.

> file called "common.h" containing a single line no #include or anything:

../../../Common/Inc/common.h
 
This maybe is a broken Linux symlink, copied to Windows as a normal file. Create a Windows symlink or Eclipse linked file.

2 replies

Pavel A.
Pavel A.Best answer
July 25, 2024

> file called "common.h" containing a single line no #include or anything:

../../../Common/Inc/common.h
 
This maybe is a broken Linux symlink, copied to Windows as a normal file. Create a Windows symlink or Eclipse linked file.
obj87Author
Associate II
July 25, 2024

Thank you so much!

This was really bothering me that I couldn't figure out what it was. It does indeed seem to be symlinks because I cloned the repository into windows as is and it runs just fine if I do it in WSL instead.