This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Compiling error "system_MKL25Z4.h" file not found despite linker path provided

I have been trying to compile a GPIO example for the FRDM-KL25Z Arm Cortex-M0+. At the beginning I run into the problem of not finding the path for "MKL25Z4.h". After a quick search online, I found that I had to add the directory path to the project's "Include Paths" (C:/Keil_v5/ARM/PACK/Keil/Kinetis_KLxx_DFP/1.15.0/Device/Include). While this solved the error, another one came out. This time is regarding the "system_MKL25Z4.h" header file. I do not understand why this error surfaced even though I already provided the full path to the directory containing this file.


I would highly appreciate any leads on how to address this situation. Plus, more kudos, if someone could explain to me why adding the full path to the directory does not solve the problem.

Furthermore, I did think of writing the full path to the preprocessor definition inside "MKL25Z4.h". However, I think that there must be a better way to address this error.

Parents
  • Hi Andy,

    Thank you for your time and prompt reply.

    First, you are right. A mistake on my end to say it was a Linker error while it is a Compiler error. What I am getting is a Compiler error.

    Take a look at the diagrams here to see how the tools in the tool chain relate, and which files are associated with which tools.

    The link provided to the diagrams that shows the association between files and tools has been very helpful visualizing and clarifying the tool chain. Many thanks for that as well.

    You do actually have that file present on your system?

    If that's in a different folder, then you also need to add that to your Includes Path.

    Yes, I do have that file present in my system, Windows OS. I got the files of interest after downloading the latest software-pack for the Kinetis KLxx series.

    The file is located within the same directory in the Path I provided when I initially started this thread. Further, the same Path has been added into the C/C++ Includes Path section. Attached is picture displaying what I assume is correct "include path" source file addition.

    Where did you obtain the example?

    Have you contacted the author/supplier for support with it?

    I've got the code example from the Embedded Systems Fundamentals with Arm Cortex-M based Microcontrollers textbook. This book is produced by ARM Education Media. Plus, I have not contacted the author. I will do that If help from this forum does not lead to a solution in the next few days.

Reply
  • Hi Andy,

    Thank you for your time and prompt reply.

    First, you are right. A mistake on my end to say it was a Linker error while it is a Compiler error. What I am getting is a Compiler error.

    Take a look at the diagrams here to see how the tools in the tool chain relate, and which files are associated with which tools.

    The link provided to the diagrams that shows the association between files and tools has been very helpful visualizing and clarifying the tool chain. Many thanks for that as well.

    You do actually have that file present on your system?

    If that's in a different folder, then you also need to add that to your Includes Path.

    Yes, I do have that file present in my system, Windows OS. I got the files of interest after downloading the latest software-pack for the Kinetis KLxx series.

    The file is located within the same directory in the Path I provided when I initially started this thread. Further, the same Path has been added into the C/C++ Includes Path section. Attached is picture displaying what I assume is correct "include path" source file addition.

    Where did you obtain the example?

    Have you contacted the author/supplier for support with it?

    I've got the code example from the Embedded Systems Fundamentals with Arm Cortex-M based Microcontrollers textbook. This book is produced by ARM Education Media. Plus, I have not contacted the author. I will do that If help from this forum does not lead to a solution in the next few days.

Children