undefined reference to `sin,`sqrt and math functions

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

undefined reference to `sin,`sqrt and math functions

4,481件の閲覧回数
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,179件の閲覧回数
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,179件の閲覧回数
vishvapathi
Contributor V

Thanks...

0 件の賞賛
返信