undefined reference to `sin,`sqrt and math functions

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

undefined reference to `sin,`sqrt and math functions

3,938 Views
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,

Labels (2)
0 Kudos
Reply
2 Replies

1,636 Views
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 Kudos
Reply

1,636 Views
vishvapathi
Contributor V

Thanks...

0 Kudos
Reply