I am on latest Raspian release with latest Qt5 pkgs and related OpenGL + MESA pkgs installed from the standard Raspian repo.

I am attempting to build a C++ program (not mine) that relies on Qt5 and OpenGL.

The compiler is complaining as follows:

error: ‘glGetTexImage’ was not declared in this scope
     glGetTexImage(GL_TEXTURE_2D, 0, GL_RED, GL_UNSIGNED_BYTE, (unsigned char *)memoryObject[0].constPointer());

Yet, immediately above that there are two other OpenGL calls that "resolve" fine:

glBindTexture(GL_TEXTURE_2D, frameBufferObjectA->texture());
glPixelStorei(GL_PACK_ALIGNMENT, 1);

Digging around, I see that glGetTexImage() is mentioned in the Qt5 provided header files which are (apparently) exposed via:

#include <QOpenGLFunctions>

I also have:

#include <QOpenGLBuffer>
#include <QOpenGLTexture>
#include <QOpenGLShaderProgram>
#include <QOpenGLVertexArrayObject>
#include <QOpenGLFramebufferObject>

In my experience, the compiler complaint usually points to a missing #include, but so far I am not finding it.

Any pointers?

What should I look at next?

Is this related to OpenGL "desktop" vs SE2?

1 Answer 1


I found an answer as to why the code doesn't build when using the OOB Raspbian OpenGL:

$ glxinfo | grep -i version
server glx version string: 1.4
client glx version string: 1.4
GLX version: 1.4
    Version: 13.0.6
    Max core profile version: 0.0
    Max compat profile version: 2.1
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 2.0
OpenGL version string: 2.1 Mesa 13.0.6
OpenGL shading language version string: 1.20
OpenGL ES profile version string: OpenGL ES 2.0 Mesa 13.0.6
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 1.0.16

And according to the following post, OpenGL ES 2 doesn't include an implementation of glGetTexImage():

StackOverflow: opengl es 2.0 android c++ glGetTexImage alternative

SOLUTION: Will either need to re-write the code, or build the full desktop version of OpenGL.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.