Hi,
I’ve been following yinjimmy’s solution to get Cocos2dx version 2.2.6 working in Android Studio.
https://discuss.cocos2d-x.org/t/cocos2dx-v2-2-6-migration-to-android-studio/45495/2
It works fine when I open and compile the project he made. I can get the project to run in the simulator and on a device using this.
But when I add more class files that use #include <math.h> I get this error “error: ‘atoi’ was not declared in this scope” in the output window.
It seems like the header files from the NDK include folder are not linked, and maybe the .so and .a files from the lib folder. Does anyone know how this can be?
I have updated the references in Android.mk to the cpp files in the project/Classes folder for the shared library. So I believe they should link to <math.h> functions. Do you have any ideas why this is not the case?
By the way I am using Android Studio 3.2.1 and NDK: r10e not NDK: r10d. I couldn’t find d but would that make a difference?
Thanks for reading.