21ic问答首页 - DSP28335中,math.h调用取整函数trunc编译报错,
DSP28335中,math.h调用取整函数trunc编译报错,
在DSP28335中,用的是CCS6.2,在main.c中首先包含了math.h,如下:
![](https://e2echina.ti.com/resized-image/__size/640x480/__key/communityserver-components-multipleuploadfilemanager/ce4c46aa_2D00_a133_2D00_464f_2D00_9d6b_2D00_3630b2ccaa04-154057-complete/pastedimage1726107940466v1.png)
然后在main.c中,调用sin,cos,atan,mod等函数都可以正常编译并使用,但是当调用trunc取整函数的时候编译报错,取整类函数ceil也不能使用,报错,如下:
![](https://e2echina.ti.com/resized-image/__size/640x480/__key/communityserver-components-multipleuploadfilemanager/ce4c46aa_2D00_a133_2D00_464f_2D00_9d6b_2D00_3630b2ccaa04-154057-complete/pastedimage1726108090161v2.png)
![](https://e2echina.ti.com/resized-image/__size/640x480/__key/communityserver-components-multipleuploadfilemanager/ce4c46aa_2D00_a133_2D00_464f_2D00_9d6b_2D00_3630b2ccaa04-154057-complete/pastedimage1726108126944v3.png)
然后我的具体调用如下,并更换了多种形式,仍然报错,只要把trunc函数换了就不报错了,
![](https://e2echina.ti.com/resized-image/__size/640x480/__key/communityserver-components-multipleuploadfilemanager/ce4c46aa_2D00_a133_2D00_464f_2D00_9d6b_2D00_3630b2ccaa04-154057-complete/pastedimage1726108235827v4.png)
我检查了math.h中是否包含了trunc,确认包含了,
![](https://e2echina.ti.com/resized-image/__size/640x480/__key/communityserver-components-multipleuploadfilemanager/ce4c46aa_2D00_a133_2D00_464f_2D00_9d6b_2D00_3630b2ccaa04-154057-complete/pastedimage1726108337401v5.png)
然后math.h调用以及文件所在是安装ccs时候默认的,如下:
![](https://e2echina.ti.com/resized-image/__size/640x480/__key/communityserver-components-multipleuploadfilemanager/ce4c46aa_2D00_a133_2D00_464f_2D00_9d6b_2D00_3630b2ccaa04-154057-complete/pastedimage1726108452046v8.png)
里面包含了math.h,然后我在lib中配置如下:
![](https://e2echina.ti.com/resized-image/__size/640x480/__key/communityserver-components-multipleuploadfilemanager/ce4c46aa_2D00_a133_2D00_464f_2D00_9d6b_2D00_3630b2ccaa04-154057-complete/pastedimage1726108520352v9.png)
请教大佬和专业工程师,我这报错,不能编译是什么原因?
您需要登录后才可以回复 登录 | 注册