达人帮我看看这个错误吧。小弟先谢过了,orz。。。
- UID
- 344010
- 性别
- 男
|
达人帮我看看这个错误吧。小弟先谢过了,orz。。。
程序:
#include /* common defines and macros */
#include /* derivative information */
#pragma LINK_INFO DERIVATIVE "mc9s12dg128b"
double angle=0.0,y=0.0;
void jishu(){
char *q=(int*)(0x1400);
double m,j=0,i=-37;
for(m=0;m<75;m++){
if((*q&0x80)==0x00){
y=y+i;
j++;
}
q++;
i++;
}
y=y/j;
angle=0.6*y;
}
void main(void) {
/* put your own code here */
EnableInterrupts;
for(;;) {
jishu();
} /* wait forever */
/* please make sure that you never leave this function */
}
错误:
Link Error : L1822: Symbol _FADD in file D:\新建文件夹 (4)\程序\cuowu\cuowu_Data\TBDML\ObjectCode\main.c.o is undefined
Link Error : L1822: Symbol _FINC in file D:\新建文件夹 (4)\程序\cuowu\cuowu_Data\TBDML\ObjectCode\main.c.o is undefined
Link Error : L1822: Symbol _FCMP in file D:\新建文件夹 (4)\程序\cuowu\cuowu_Data\TBDML\ObjectCode\main.c.o is undefined
Link Error : L1822: Symbol _FDIV in file D:\新建文件夹 (4)\程序\cuowu\cuowu_Data\TBDML\ObjectCode\main.c.o is undefined
Link Error : L1822: Symbol _FMUL in file D:\新建文件夹 (4)\程序\cuowu\cuowu_Data\TBDML\ObjectCode\main.c.o is undefined
Link Error : Link failed |
|
|
|
|
|
- UID
- 343082
- 性别
- 男
|
|
|
|
|
|
- UID
- 344010
- 性别
- 男
|
就是用char也不行啊,还是出一样的错。
不过把这俩句:
y=y/j;
angle=0.6*y;删了就不报错了。到底是什么原因呢? |
|
|
|
|
|
- UID
- 343082
- 性别
- 男
|
0.6是浮点数呀,要用小数就要在生成工程时没有选择使用浮点数 。你把0.6改成6就不会出错啦
[此贴子已经被作者于2007-6-13 19:11:46编辑过] |
|
|
|
|
|
- UID
- 344010
- 性别
- 男
|
|
|
|
|
|