Hi, i'am trying to use mathematic Functions in my application on the WICED SMART SDK , so i included "math.h" in my c file but i get this error when i use this line double c = sqrt(10);

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

C:\Users\PC-ASUS\Documents\WICED\WICED-Smart-SDK-2.2.0\WICED-Smart-SDK\Wiced-Smart\spar/../../Apps/wiced_sense/wiced_sense.c:1267: undefined reference to `sqrt'

1 Solution
7 Replies
Anonymous
Not applicable

i have the same problem all the mathematic functions doesn't work i think there's a problem in the links

0 Likes
Anonymous
Not applicable

Hello,

I am trying to use math functions as well and I am also getting errors such as:

undefined reference to `sqrt'

undefined reference to `__aeabi_i2f'

undefined reference to `__aeabi_fmul'


Could you explain how you managed to use math functions included in math.h ?

0 Likes
Anonymous
Not applicable

yes i didn't find the way to use that functions even with an external libraries so i used another function that calculate the sqrt only with integers and i multiple the input value (*10,100..) of the function to have the sensibility that i want to get then i devied the output this is the only way i found , the wiced smart sdk do not support floats

0 Likes
Anonymous
Not applicable

this is the code :

#define NEXT(n, i)  (((n) + (i)/(n)) >> 1)

  int abso (int n)

  {

      if (n<0) return (-n);

      else return n ;

  }

  unsigned int isqrt(int number) {

  unsigned int n  = 1;

  unsigned int n1 = NEXT(n, number);

   while(abso(n1 - n) > 1) {

     n  = n1;

     n1 = NEXT(n, number);

   }

   while(n1*n1 > number)

     n1--;

   return n1;

  }

0 Likes
Anonymous
Not applicable

Thanks for your quick replies!

Besides sqrt, I also need some trigonometric functions, so I will probably look into libfixmath.

Best regards

0 Likes