My app.cpp:
#include "app.h"
#include <EGL/egl.h>
#include <EGL/eglext.h>
void
Java_com_geek_hello_FilterStack_nativeEglSetFenceAndWait(JNIEnv* env, jobject thiz) {
EGLDisplay display = eglGetCurrentDisplay();
// Create a egl fence and wait for egl to return it.
// Additional reference on egl fence sync can be found in:
// http://www.khronos.org/registry/vg/extensions/KHR/EGL_KHR_fence_sync.txt
EGLSyncKHR fence = eglCreateSyncKHR(display, EGL_SYNC_FENCE_KHR, NULL);
if (fence == EGL_NO_SYNC_KHR) {
return;
}
...
When I run ndk-build, it fails finding methods present in egl.h and .so is not created. Here's the log:
app.cpp:31:72: error: 'eglCreateSyncKHR' was not declared in this scope
followed by all KHR methods that belong to
Here's Android.mk
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
#LOCAL_CFLAGS += -DEGL_EGLEXT_PROTOTYPES
LOCAL_CFLAGS = -Wno-psabi
LOCAL_SRC_FILES := app.cpp
#LOCAL_SHARED_LIBRARIES := libcutils libEGL
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := libapp
LOCAL_LDLIBS := -llog -landroid -lEGL -lGLESv2
include $(BUILD_SHARED_LIBRARY)