cancel
Showing results for 
Search instead for 
Did you mean: 

Including path to linked files doesn't work as expected

Robert Poor
Associate III

I've created an STM32 Project, selected the NUCLEO-G431RB board and generated the code. I've added a source folder to the project (mu_platform) and LINKED some .c and .h files into that folder.

0693W00000QKVG9QAP.pngI selected mu_platform folder and right-clicked "Add/remove include path", and checked the project properties to see that it was added. It looked right:

0693W00000QKVFzQAP.pngBut now when I compile, the C preprocessor says that it cannot find the .h files inside mu_platform, e.g. mu_time.h, although it's linked into the mu_platform directory:

C:/Users/r/Projects/mulib-examples/mu_platform/nucleo_g431rb/mu_time.c:28:10: fatal error: mu_time.h: No such file or directory
   28 | #include "mu_time.h"

Is this because the C preprocessor does not resolve LINKED files? In other words, do I need to specify the file system directory as the included directory rather than the Project Directory's linked directory?

(Hope this makes sense!)

1 ACCEPTED SOLUTION

Accepted Solutions
Robert Poor
Associate III

After some experimentation, I've answered my own question: the C preprocessor doesn't know about the symbolic links that Eclipse has created in the Project Directory. (This actually makes sense: if you look at the mu_platform directory in the File Explorer, you'll see that it's empty. Presumably the C preprocessor will see the same thing...)

In this specific case, the proper settings for the Include Directory ended up being this:

0693W00000QKVJSQA5.png

View solution in original post

3 REPLIES 3
Robert Poor
Associate III

After some experimentation, I've answered my own question: the C preprocessor doesn't know about the symbolic links that Eclipse has created in the Project Directory. (This actually makes sense: if you look at the mu_platform directory in the File Explorer, you'll see that it's empty. Presumably the C preprocessor will see the same thing...)

In this specific case, the proper settings for the Include Directory ended up being this:

0693W00000QKVJSQA5.png

@Robert Poor​ ​ "I've answered my own question"

Please mark your solution:

0693W000008y9fZQAQ.png 

Duly noted and done -- thank you.