neko_code
neko_code

Reputation: 586

Android studio NDK Undefined reference to GL functions

I made small JNI-based project. I do #include GLES3/gl3.h in my C code and it works. But when I try to use ANY OpenGL function it says Undefined reference to gl*. My Android.mk is:

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

LOCAL_MODULE    := hello-jni
LOCAL_CFLAGS    := -Wall -Wextra
LOCAL_SRC_FILES := hello-jni.c
LOCAL_LDLIBS := -lGLESv3 -ldl -llog
LOCAL_STATIC_LIBRARIES := android_native_app_glue
include $(BUILD_SHARED_LIBRARY)

What I am doing wrong? Could some one tell me what's wrong?

Upvotes: 3

Views: 3350

Answers (1)

Bram
Bram

Reputation: 8273

Try linking to EGL as well.

For my projects, I use these libraries:

LOCAL_LDLIBS    := -llog -landroid -lEGL -lGLESv3

Upvotes: 1

Related Questions