Cant use float operations

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Cant use float operations

806 次查看
Nanouser
Contributor I

Hi there,

 

i got a problem using HC12 and CW 5.9:

 

i want to multiply two floats:

 

float x = 0.1;

float y = 0.2;

float z = 0.3;

 

z = x *y;

 

if i try to run this i get following error: "L1822: Symbol _FMUL in file X:/XXXX/XXX.c.o is undefined".

 

operations like z = x+y; or z = x-y; are also not possible giving an according error.

 

why is this? how can i fix this problem? simple float multiplications should be possible!

 

i already removed the -D__NO_FLOAT__  parameter from the compiler settings. didn´t work. making a new project also doesn´t work, but i cant see a floating point option anywhere in the wizard anyway.

 

Thanks

 

~nano~

标签 (1)
0 项奖励
回复
1 回复

610 次查看
CrasyCat
Specialist III

Hello

 

  You did not link the appropriate ANSI library file to your application.

 

  You need to create a new project using the project wizard and make sure you enable floating point

  operation in the newly created project.

 

CrasyCat

0 项奖励
回复