Undefined ref on strtof

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

cross mob
huangj
Level 4
Level 4
Welcome! 25 replies posted 10 replies posted

Hi,

I would like use the API(strtof) on my code. But I got a error message(undefined reference to `strtof') after building my code.

I include the header file(stblib.h) in my code, but the error message is still there.Should I need to modify the makefile? Or strof didn't in the ROM?

Jack,

0 Likes
1 Solution
BoonT_56
Employee
Employee
500 likes received 250 likes received 100 likes received

I checked internally and found that our solution does not support floating point types. And you are right, not all of the standard library is included in the ROM.

View solution in original post

3 Replies
BoonT_56
Employee
Employee
500 likes received 250 likes received 100 likes received

Can you elaborate this API a little? I can't find it in the reference guide.

0 Likes

Hi boont,

The strtof converts string to float.

Example:

char *a;

float b = stortof("12.345",&a);

The API is define in the stblib.h(WICED-Smart-SDK\Tools\ARM_GNU\include).

Jack,

0 Likes
BoonT_56
Employee
Employee
500 likes received 250 likes received 100 likes received

I checked internally and found that our solution does not support floating point types. And you are right, not all of the standard library is included in the ROM.