I am trying to port some boilerplate code of mine to work on android, using the android ndk & NativeActivity
So far I have just one file that defines the glue between android and my code and it works fine. It includes one GLIncludes file, that sorts out the includes based on platform
However, if I add glm headers to the GLIncludes file, becoming:
#ifdef __ANDROID_API__ #include <EGL/egl.h> #include <GLES/gl.h> #include <GLES/glext.h> #endif #include "glm/glm.hpp" #include "glm/gtc/matrix_transform.hpp" #include "glm/gtc/type_ptr.hpp"
ndk-build then complains about not finding glm.hpp:
In file included from jni/src/GLIncludes.h:41:0, from jni/androidLauncher.cpp:4: jni/src/glm/glm.hpp:86:18: fatal error: limits: No such file or directory
I have verified that the file does indeed lie at < ANDROID_PROJECT_ROOT >/jni/src/glm/glm.hpp so what could be the problem?
Here is my Android.mk file that sits in the jni folder:
LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := libglobes LOCAL_CFLAGS := -Werror LOCAL_LDLIBS := -llog -lGLESv1_CM -lEGL -lm -landroid LOCAL_CPP_EXTENSION := .cpp LOCAL_STATIC_LIBRARIES := android_native_app_glue LOCAL_SRC_FILES := androidLauncher.cpp include $(BUILD_SHARED_LIBRARY) $(call import-module,android/native_app_glue)
My directory structure is:
< ROOT > src/ (dir with all sources in it) GLIncludes.h glm/ glm.hpp android/ (base dir for android port) jni/ androidLauncher.cpp Android.mk src/ (symbolic link to upper src folder with same contents)
So why is the ndk-build not seeing the glm.hpp files? Is it because it is too deep? or is it because of the symbolic link? Or is it something else completely?