Open GL ES error: undefined reference to 'glDispatchCompute'

时光怂恿深爱的人放手 提交于 2019-12-13 04:11:50

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!