Open GL ES错误:未定义对'glDispatchCompute'的引用 [英] Open GL ES error: undefined reference to 'glDispatchCompute'
问题描述
我在具有本地C ++代码的Android应用中使用Open GL ES 3.1.因此,我需要运行一个具有Android支持的C ++库.
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.
我使用了一些Open GL ES函数,并且它们运行良好.但是,当我尝试使用glDispatchCompute
时,链接程序给出了以下error: undefined reference to 'glDispatchCompute'
.
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'
.
这是电话:
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>
以下是我对c的选择:
-lGLESv3 -lGLESv2 -lGLESv1_CM -lEGL
我也尝试过-lGLESv3 -lEGL
具有相同的效果.
Also I tried -lGLESv3 -lEGL
with the same effect.
推荐答案
问题在于未使用正确的Java库和活动.在示例应用程序中,Java有3个活动.添加它们后,一切运行良好.
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.
这篇关于Open GL ES错误:未定义对'glDispatchCompute'的引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!