LPC546xx __disable_irq() linker error when called from .c file in a C++ project

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

LPC546xx __disable_irq() linker error when called from .c file in a C++ project

935 次查看
gbarcan
Contributor II

Has anyone stumbled upon this linker error ?

arm-none-eabi-c++ -nostdlib

-Xlinker --gc-sections -Xlinker

-print-memory-usage -Xlinker

--sort-section=alignment

-mcpu=cortex-m4

-mfpu=fpv4-sp-d16

-mfloat-abi=hard

-mthumb

-lpower_hardabi

other.c:68: undefined reference to `__enable_irq'

Calling it from a C++ file seem to link just fine.

Project is set to use NewlibNano.

标记 (1)
0 项奖励
回复
1 回复

830 次查看
Omar_Anguiano
NXP TechSupport
NXP TechSupport

Hello gbarcan@dialight.com

If you are using the wrong library variant, then you will see build errors of the form:
"Undefined reference to ‘xxx’"

For information about the library variants I suggest you to check chapter 17.2 Library variants of MCUXpresso IDE User Guide
https://www.nxp.com/docs/en/user-guide/MCUXpresso_IDE_User_Guide.pdf

Also I will suggest to check the following link with tips for mixing C and C++:
https://isocpp.org/wiki/faq/mixing-c-and-cpp


Let me know if this helps
Best regards

Omar

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

0 项奖励
回复