Skip to main content
Robert Poor
Associate III
July 5, 2022
Solved

Including path to linked files doesn't work as expected

  • July 5, 2022
  • 1 reply
  • 2804 views

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!)

This topic has been closed for replies.
Best answer by Robert Poor

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

1 reply

Robert Poor
Robert PoorAuthorAnswer
Associate III
July 5, 2022

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

Andrew Neil
Super User
July 6, 2022

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

Please mark your solution:

0693W000008y9fZQAQ.png 

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Robert Poor
Associate III
July 6, 2022

Duly noted and done -- thank you.