Open GL ES error: undefined reference to 'glDispatchCompute'

Open GL ES error: undefined reference to 'glDispatchCompute'

我在 Android 应用程序中使用 Open GL ES 3.1 和本机 C++ 代码。所以我需要 运行 一个支持 Android 的 C++ 库。

我使用了一些 Open GL ES 函数,它们运行良好。但是当我尝试使用 glDispatchCompute 时,链接器给出了以下 error: undefined reference to 'glDispatchCompute'

调用如下:

glDispatchCompute(10, 1, 1);

这是我的收录:

#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>

以下是我的 clang 选项:

-lGLESv3 -lGLESv2 -lGLESv1_CM -lEGL

我也试过-lGLESv3 -lEGL效果一样。

问题在于没有使用正确的 java 库和活动。在 sample app 中,Java 中有 3 个活动。添加它们后一切正常。