Skip to main content



      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 14:19 Go to next message
Eclipse UserFriend
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 727 times)
  • Attachment: linking2.PNG
    (Size: 47.36KB, Downloaded 772 times)
Re: including files from a C library [message #1822866 is a reply to message #1822553] Mon, 16 March 2020 04:16 Go to previous messageGo to next message
Eclipse UserFriend
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 04:22] by Moderator

Re: including files from a C library [message #1823371 is a reply to message #1822866] Wed, 25 March 2020 11:35 Go to previous message
Eclipse UserFriend
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: Sat Aug 30 15:37:50 EDT 2025

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

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

Back to the top