LPCXpresso add header file to include path

cancel
Showing results for 
Search instead for 
Did you mean: 

LPCXpresso add header file to include path

1,174 Views
mateuszkiełbasa
Contributor III

I would like to add simple own library to project include path. Project structure (I created folder delay)

-project

   -Includes

   -src

   -Debug

   -delay

      -inc

         -delay.h

      -src

         -delay.c

In project.c I added #include "inc/delay.h"

I added new include path in MCU C Compiler -> Includes -> Include path like this: "${workspace_loc:/project/delay}". When I try to Build it I get error:

/home/user/LPCXpresso/workspace/project/Debug/../src/project.c:41: undefined reference to `Delay_Init'
/home/user/LPCXpresso/workspace/project/Debug/../src/project.c:47: undefined reference to `Delay'

Delay_Init and Delay was created in delay.h and delay.c

Labels (1)
Tags (1)
3 Replies

194 Views
athmesh_n
Contributor IV

For including a header to a file, 

Go to: Project -> Properties ---> Select "Project Reference under the left tab", select the board and chip header files.LPC.png

194 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Mateusz,

Con Verse's reply is correct, your head file in under delay/inc, so you still need to add /inc.

Please add it and try again.

Wish it helps you!

If you still have question, please let me know!


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

194 Views
converse
Senior Contributor IV

Specify the directories where the include files are. So if it is in delay/inc, the add delay/inc, not just delay as you have done.