opengl-esopengl-es-3.0opengl-es-3.1

Open GL ES error: undefined reference to 'glDispatchCompute'


I am using Open GL ES 3.1 in Android app with native C++ code. So I need to run a C++ lib with Android support.

I have used some Open GL ES functions and they worked well. But when I tried to use glDispatchCompute, a linker gave a following error: undefined reference to 'glDispatchCompute'.

Here is the call:

glDispatchCompute(10, 1, 1);

Here are my includes:

#include <string>
#include <jni.h>
#include <GLES3/gl31.h>
#include <GLES/egl.h>
#include <GLES/gl.h>
#include <GLES3/gl3ext.h> 
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

Here are my options for clang:

-lGLESv3 -lGLESv2 -lGLESv1_CM -lEGL

Also I tried -lGLESv3 -lEGL with the same effect.


Solution

  • The problem was in not using proper java libraries and activities. In sample app there are 3 activities in Java. After adding them everything worked well.