link error undefined reference

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

link error undefined reference

1,035 次查看
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 回复数

834 次查看
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 项奖励

834 次查看
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 项奖励