I'm trying to create an application using the NDK. I'm using ndk-build because I'm also using some external libraries which don't yet support CMake. This is the relevant line in Android.mk:
LOCAL_LDLIBS := -lEGL -lGLESv3
Everything builds (compiles and links) just fine, but when I try to use a function from OpenGL ES 3.0+ (like glGenVertexArrays
), I get a segmentation fault.
When I look into the debugger, though, I see this:
So, it is linking against libGLESv1_CM.so
for reasons I don't understand.
Also, on my header files, I have #include <GLES3/gl3.h>
and my device supports OpenGL ES 3.2 (I also saw the libGLESv3.so
file on /system/lib/
).
What could I be missing?
The external library I was using included the source
gl3stub.c
, presumably for supporting older OpenGL ES specifications. This was nullifying the pointers to newer APIs. Removing this source and recompiling the external library solved the issue.