【问题标题】:Open GL ES error: undefined reference to 'glDispatchCompute'打开 GL ES 错误:未定义对“glDispatchCompute”的引用
【发布时间】:2018-12-18 12:03:45
【问题描述】:

我在带有原生 C++ 代码的 Android 应用程序中使用 Open GL ES 3.1。所以我需要运行一个支持 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,效果一样。

【问题讨论】:

  • 到目前为止,我意识到不起作用的功能是特定于设备的,Open GL ES 仅包含它们的标头。

标签: opengl-es opengl-es-3.0 opengl-es-3.1


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-01-17
    • 1970-01-01
    • 1970-01-01
    • 2012-03-22
    • 1970-01-01
    • 2016-10-03
    • 2021-09-07
    • 2012-02-27
    相关资源
    最近更新 更多