I am trying to pull some code from another project into an NDK project, and when I build I’m getting the following error:
error: 'modfl' was not declared in this scope
In the source file I have #import <math.h> and the call is as follows:
long double tempValLong;
double tempValDouble; // This is initialized to a decimal number
long double n = modfl(tempValDouble , &tempValLong);
Application.mk includes APP_STL := gnustl_static. Am I missing something, or does Android not include the modfl function?
First of all – #import is very non-standard directive in C/C++ code. You should use #include.
As for modfl – Android NDK doesn’t have it. Most likely because of cross-platform issues. long double is not supported on ARM. You should use
doubleinstead oflong doubleand use themodffunction.