link error undefined reference

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

link error undefined reference

2,075件の閲覧回数
harrykoukoutos
Contributor I

I am using MCUXpresso to build an MK10 project. The startup file, startup_mk10d10.cpp, cannot find functions in other modules, for example interrupt service routines or utilities. The IDE gives , as an example, an undefined reference to `PIT1_DriverIRQHandler' error, although it is defined in an other file and a definition line is included. It links only main(). Clearly I have set something wrong! How should I define routines in other modules? Please note that all other files link properly.

Thank you,

Harry Koukoutos

0 件の賞賛
返信
2 返答(返信)

1,874件の閲覧回数
lpcxpresso_supp
NXP Employee
NXP Employee

Given that the file extension of your startup file is ".cpp", I suspect the issue is C vs C++ linkage. There is some information in the following FAQs (which although originally written for LPCXpresso IDE, still apply to MCUXpresso IDE): 

Interrupt Handlers in C++ applications 

https://community.nxp.com/message/630742 

Regards,

MCUXpresso IDE Support

0 件の賞賛
返信

1,874件の閲覧回数
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Harry Koukoutos,

    I highly recommend you to refer to the nxp official code, it will have the according startup file, and the according project.

   Please download it from this link:

https://mcuxpresso.nxp.com/en/select 

  Select the processors as your K10D100M chip, then generate the MCUXpresso IDE project, and try it again.

  If you still have question about it, please kindly let me know.


Have a great day,
Kerry

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

0 件の賞賛
返信