This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] MCU-PLUS-SDK - AM243X:C++和 ti_arm_trig.h、未解析符号、名称改编

Guru**** 2207170 points
Other Parts Discussed in Thread: MATHLIB
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1260150/mcu-plus-sdk-am243x-c-and-ti_arm_trig-h-unresolved-symbols-name-mangling

器件型号:MCU-PLUS-SDK
主题中讨论的其他器件:MATHLIB

您好!
我正在为 AM243x 上的一个项目开发 C++代码。
在某个时候、我想使用 mathlib/trig/ ti_arm_trig.h 。 问题是我遇到了链接器错误、例如

[build]  undefined         first referenced                                                                      
[build]   symbol               in file                                                                           
[build]  ---------         ----------------                                                                      
[build]  ti_arm_sin(float) sensor/MyComponent.cpp.obj

问题是 C++正在使用名称改编,因此 ti_arm_sin ()无法解决。 TI SDK 的许多其他文件中正确包含以下内容

#ifdef __cplusplus
extern "C" {
#endif

// ... code ...

#ifdef __cplusplus
}
#endif

很遗憾、在 ti_arm_trig.h 中没有。 这是根据设计吗? 我在代码中通过使用

extern "C"
{
#include <mathlib/trig/ti_arm_trig.h>
}

但它看起来应该在 ti_arm_trig.h 中被修复吗?

此致

多米尼克

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Dominik:

    您对  mathlib/trig/ti_arm_trig.h 的描述是正确的。 它确实错过了以下内容:

    #ifdef _cplusplus
    extern "C"{
    #endif

    ...

    #ifdef _cplusplus

    #endif

    我将为此问题提交 JIRA 票证。 该错误应在下一个 MCU+ SDK 版本中修复。

    此致、

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    谢谢!