问题
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.
回答1:
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.
来源:https://stackoverflow.com/questions/51268670/open-gl-es-error-undefined-reference-to-gldispatchcompute