Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » including files from a C library
including files from a C library [message #1822553] Mon, 09 March 2020 18:19 Go to next message
Tye Shutty is currently offline Tye ShuttyFriend
Messages: 1
Registered: March 2020
Junior Member
I have little experience with Eclipse. I am specifically using Kinetis Design Studio version of Eclipse., on Window 10.

I'm trying to use a file "in" a library, fsl_clock_MK64F12.h. Highlighted here:
index.php/fa/37545/0/

I have linked to the library libksdk_platform.a successfully (see image below).
index.php/fa/37546/0/

I saw this [post](https://www.eclipse.org/forums/index.php/m/1765382/?srch=including+files+from+a+C+library#msg_1765382) on the forum, so I added the file path "C:\Freescale\KSDK_1.3.0\lib\ksdk_platform_lib\kds\K64F12" to the Preprocessor Includes Path and in all the Includes paths in the C/C++ Build/Settings Tool Settings tab.

But my includes statement in my source code results in "fsl_clock_MK64F12.h: No such file or directory". How do I include this file?
  • Attachment: linking1.PNG
    (Size: 69.77KB, Downloaded 668 times)
  • Attachment: linking2.PNG
    (Size: 47.36KB, Downloaded 631 times)
Re: including files from a C library [message #1822866 is a reply to message #1822553] Mon, 16 March 2020 08:16 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
You have to tell two different things where your headers can be found:

  1. the compiler via the makefile
  2. the CDT Indexer

They are independent.

To do (1) Set the include path for each compiler at:
Project --> Properties --> C/C+ Build --> Settings --> Tool Settings tab --> <compiler> --> Includes
This only works when Eclipse is generating the Makefile.

To do (2) Set the include path as a User Entry at:
Project --> Properties --> C/C++ General --> Preprocessor Include Paths, Macros etc. --> Entries tab --> <language>

From your images, the include path for the clock header appears to be
<workspace dir>/ksdk_platform_lib_K64F12/platform/clock/system
Where: <workspace dir> is the absolute path to your workspace
You can use the workspace drop down (or button depending on which dialog) to select subdirectories in your workspace.

The library path appears to be:
<workspace dir>/ksdk_platform_lib_K64F12/debug

ksdk_platform_lib_K64F12 appears to be a project in your workspace.

As a side-note:
the second entry for lib searches starting with $(ProjDirPath)/Proj_Settings ...
doesn't contain a library from what I can see.
It doesn't hurt to keep it but it's useless and can be removed.



[Updated on: Mon, 16 March 2020 08:22]

Report message to a moderator

Re: including files from a C library [message #1823371 is a reply to message #1822866] Wed, 25 March 2020 15:35 Go to previous message
juerg maier is currently offline juerg maierFriend
Messages: 8
Registered: March 2020
Junior Member
These menu path's do not exist in Eclipse 2020-03
Previous Topic:Eclipse 2020-03 No upload to Arduino Due
Next Topic:Doxygen plugin for C++ documentation
Goto Forum:
  


Current Time: Tue Sep 24 15:52:34 GMT 2024

Powered by FUDForum. Page generated in 0.04145 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top