浮点数赋值问题
laiyh 2010-01-28 01:49:01 在brew中,用浮点数给整型数赋值,链接时会报错,例如:
double val=3.14;
int test = val;//或(int)val
链接时报错:
Error: L6265E: Non-RWPI Section libspace.o(.bss) cannot be assigned to PI Exec region ER_ZI.
Error: L6248E: libspace.o(.text) in PI region 'ER_RO' cannot have address type relocation to __libspace_start in PI region 'ER_ZI'.
Finished: 0 information, 0 warning and 2 error messages.
请问有经验人士这是什么原因呢?有什么办法解决?程序中有不少这种赋值。谢谢!