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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

775 Views
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.

Tags (1)
0 Kudos
1 Reply

670 Views
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 Kudos