- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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'

Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

i solved the problem was in the conversion from i16_t to double

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

i solved the problem was in the conversion from i16_t to double

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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 ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

I think you will find these two threads helpful:

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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;

}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Thanks for your quick replies!

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

Best regards