LPCXpresso add header file to include path

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

LPCXpresso add header file to include path

3,011件の閲覧回数
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,031件の閲覧回数
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,031件の閲覧回数
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,031件の閲覧回数
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.