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

1,289件の閲覧回数
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 返信

1,184件の閲覧回数
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 件の賞賛
返信