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.

[参考译文] 编译器:与CCS6?兼容的FastRTS库 -> powf()问题

Guru**** 2526700 points
Other Parts Discussed in Thread: SFRA

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

https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/569552/compiler-fastrts-library-compatible-with-ccs6---powf-problem

主题中讨论的其他部件:SFRA

工具/软件:TI C/C++编译器

您好,

根据SPRCA75,C28x浮点单元fastRTS“该库可与CCS 3.3 或CCS 4一起使用。”

我使用6.2

我还使用rts2800_fpu32.lib。

使用powf (x,y)函数时出现以下错误:

重新定义符号"_sqrt":首先在"../../lib/rts2800_fpu32_fast_supply.lib<sqrt_F32.obj>"中定义;
在"..\compiler\c2000_sql.4.lts\lib\rts2800_fpu32.lib<e_sqltf.obj>"中2800中重新定义15.12

谢谢你。

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

    将以下代码添加到程序中的某个位置。

    #include <math.h>
    #include <float.h>
    
    #if DBL_mant_dig == FLT_mant_dig
    float cosf(float x){ return cos(x);}
    float sin(float x){ ret(x);}
    float sqrtf(float x){ return sqrt(x);}
    #endif 

    出现此错误的原因是因为程序在某个位置同时使用sqrt和sqrtf。 在调用sqltf的位置可能不会立即明显;它可能位于库函数(如printf)中。 现在编译器库支持C99,我们不仅支持sqrt,还支持sqrtf和sqrtl。 对于每个目标TI支持的,sqrtf或sqrtl中的一个只是sqrt的别名,并在同一文件中定义。 您已替换sqrt,但链接器仍需要sqrtf,因此它必须在定义sqrtf (也包含sqrt)的目标文件中拖动,现在您已获得sqrt的重复定义。 因此,在替换sqrt时,还必须替换其别名(在本例中为sqrtf,因为对于C2000 COFF,双精度是32位)。

    经验法则:如果替换sqrt,则还必须替换sqrtf和sqrtl。

    另请参阅

    https://e2e.ti.com/support/development_tools/compiler/f/343/t/56.4853万

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

    很抱歉,如果这样做,我会收到以下错误:

    #249函数"__RELEATE_COSTF"已经定义
    #249函数"__RELEARD_SINF"已定义
    #249函数"__RELEATE_SQrtf"已定义

    我还使用:
    SFO_TI_build_v8_FPU.lib
    SFRA_F_Lib.lib

    我的代码中不使用sqrt。 我可以想象Manish在SFRA库中使用了它。


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

    因为您收到了这些错误消息,所以我知道您正在使用选项“--fp_mode=lreeles --tmu_support”

    基本问题仍然是相同的(FPUFASTTRTS-30),但解决方法有点奇怪:

    #include <float.h>
    
    #if DBL_mant_dig == FLT_Mant_dig
    #if defined(__TMS320C28XX_TMU__)&&!__TI_Strict_FP_mode_____lined
    float__relisel_cosf (float x);__lined
    float_cosf;{{ do_float
    
    __sf;}{{双float __sf;}{{双float_sf;}{{双float_sf;}{{双float f;sf;}{{双float_trat_rf;}{{双f;sf;}{{双f;sf;f;}{{双float_f;f;f;}{{双float_f;f;f;}{{双flout}{{双
    f;
    
    
    
    
    
    float cosf (float x){ return cos(x);}
    float sinf (float x){ return
    sqrtf (float x){ return sqrt(x);}
    #endif
    #endif
    
    #include <mathing.h>