undefined reference to `sin,`sqrt and math functions

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

undefined reference to `sin,`sqrt and math functions

4,468 次查看
vishvapathi
Contributor V

Hi,

I am using I.MX 6Q with Linux freescale 3.0.35-2508. I am trying to do some maths calculations, when i use sin,cos or sqrt function i am getting error.

Multiple markers at this line

    - undefined reference to

     `cos'

    - undefined reference to

     `sin'

I have included math.h header.

Kindly advice how to over come this issue,

标签 (2)
0 项奖励
回复
2 回复数

2,166 次查看
Yuri
NXP Employee
NXP Employee

Please use -lm option in GCC command line in order to include math libs.:

As for Eclipse :

Dystopian Code: Solving Gcc Math.h Linking Problem in Eclipse

0 项奖励
回复

2,166 次查看
vishvapathi
Contributor V

Thanks...

0 项奖励
回复