The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Use SDL on android. Failed loading EGL function.
isfrank


Joined: 15 Jun 2015
Posts: 1
I am trying to run my first SDL hello-world project on android. I use the android project template provided in SDL source package, it use a class called SDLActivity to communicate with android and native c/c++ code. I import them into Eclipse android project, then slightly modify AndroidManifest.xml, Application.mk in folder jni, and Android.mk in folder jni/src .

The project compiled successfully. But when it runs on simulator (I use GenyMotion), I got error message in logcat.
E/SDLActivity(1472): Failed loading eglChooseConfig: Invalid library handle

I also try to debug on a real device. I got this message:
E/SDLActivity(28020): Failed loading eglChooseConfig: dlsym library handle is null

I tried to add "System.loadLibrary("EGL");" in SDLActivity.java . Not work.

Here is my Android.mk in jni/src
Code:

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := main

SDL_PATH := ../SDL

LOCAL_C_INCLUDES := $(LOCAL_PATH)/$(SDL_PATH)/include

# Add your application source files here...
LOCAL_SRC_FILES :=  $(SDL_PATH)/src/main/android/SDL_android_main.c \
main.cpp

LOCAL_SHARED_LIBRARIES :=SDL2

LOCAL_LDLIBS := -lGLESv1_CM -lGLESv2 -llog -lEGL

include $(BUILD_SHARED_LIBRARY)