在avr studio环境下编译三角函数出现编译错误问题 30
当我测试LSM303DLH的倾角补偿算法时cos_roll=(double)cos(roll);sin_roll=(double)sin(roll);cos_pitch=...
当我测试LSM303DLH的倾角补偿算法时
cos_roll = (double)cos(roll);
sin_roll = (double)sin(roll);
cos_pitch = (double)cos(pitch);
sin_pitch = (double)sin(pitch);
x2 = ((double)(x-MX_MIN) / (double)(MX_MAX - MX_MIN))*2-1;
y2 =((double)(y-MY_MIN )/ (double)(MY_MAX - MY_MIN))*2-1;
x2 = (x * cos_pitch + z * sin_pitch);
y2 = (x * sin_roll * sin_pitch + y * cos_roll - z * sin_roll * cos_pitch);
出现relocation truncated to fit: R_AVR_13 错误.不是头文件没有添加,请问编译三角函数要注意什么 展开
cos_roll = (double)cos(roll);
sin_roll = (double)sin(roll);
cos_pitch = (double)cos(pitch);
sin_pitch = (double)sin(pitch);
x2 = ((double)(x-MX_MIN) / (double)(MX_MAX - MX_MIN))*2-1;
y2 =((double)(y-MY_MIN )/ (double)(MY_MAX - MY_MIN))*2-1;
x2 = (x * cos_pitch + z * sin_pitch);
y2 = (x * sin_roll * sin_pitch + y * cos_roll - z * sin_roll * cos_pitch);
出现relocation truncated to fit: R_AVR_13 错误.不是头文件没有添加,请问编译三角函数要注意什么 展开
2个回答
展开全部
你用的也是AVR Studio+WinGCC吧。我编译这段没有问题,可否把你的文件发我看看,这个错误应该就是软件环境的配置问题。老外网站说是bug,不过都是2007年的帖子。
追问
你好.怎么发给你看呢.可以留下邮箱吗?
追答
beiwei90du@163.com
-----------------------------------------------------
基本配置,编译通过。
AVR Memory Usage
----------------
Device: atmega16
Program: 5578 bytes (34.0% Full)
(.text + .data + .bootloader)
Data: 290 bytes (28.3% Full)
(.data + .bss + .noinit)
Build succeeded with 0 Warnings...
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询