LPCXpresso add header file to include path

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

LPCXpresso add header file to include path

3,006 次查看
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

标签 (1)
标记 (1)
3 回复数

2,026 次查看
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

2,026 次查看
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!
-----------------------------------------------------------------------------------------------------------------------

2,026 次查看
converse
Senior Contributor V

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.