原因:android的stdlib.h中atof是内联的
解决方法:将所有的atof改成strtod
示例代码:
char *strpi = "3.1415";
double dpi;
dpi = atof(strpi); 修改为: dpi = strtod(strpi, NULL);
参考自:http://stackoverflow.com/questions/14571399/Android-ndk-cant-find-atof-function
原文如下:
From stdlib.h in the Android source;
static __inline__ double atof(const char *nptr)
{
return (strtod(nptr, NULL));
}
atof
is in other words not a library function, it's an inline function that calls strtod
.
If you need to call through loading a library, just use strtod
instead.