'Add a library in Android.mk

I don't now how many time I try to add a library in my Android.mk, but nothing work.

My Android.mk

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE    := canvas
LOCAL_SRC_FILES := canvas.cpp

ifeq ($(TARGET_ARCH_ABI),x86)
    LOCAL_CFLAGS += -ffast-math -mtune=atom -mssse3 -mfpmath=sse
endif

include $(BUILD_STATIC_LIBRARY)



include $(CLEAR_VARS)

LOCAL_MODULE    := ui
LOCAL_SRC_FILES := ui.cpp

ifeq ($(TARGET_ARCH_ABI),x86)
    LOCAL_CFLAGS += -ffast-math -mtune=atom -mssse3 -mfpmath=sse
endif

include $(BUILD_STATIC_LIBRARY)



include $(CLEAR_VARS)

LOCAL_MODULE    := android-paint
LOCAL_SRC_FILES := main.cpp

LOCAL_LDLIBS := -llog -landroid -lEGL -lGLESv1_CM
LOCAL_STATIC_LIBRARIES := android_native_app_glue

ifeq ($(TARGET_ARCH_ABI),x86)
    LOCAL_CFLAGS += -ffast-math -mtune=atom -mssse3 -mfpmath=sse
endif

include $(BUILD_SHARED_LIBRARY)

In my main.cpp

#include <EGL/egl.h>
#include <GLES/gl.h>

#include <android/sensor.h>
#include <android/log.h>
#include <android_native_app_glue>


#include <ui.cpp>
#include <string.h>
#include <math.h>
#include <jni.h>

...

Error:

  NDK: jni/main.cpp:1:21: fatal error: EGL/EGL.h no such file or directory

it don't work anyway, and, how you can see in my Android/mk, I have multiple .CPP files, so, I need to add this libraries to each file and... I have no idea to how I can make it



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source