Arch
Arch

Reputation: 51

Loading OpenGL extensions with Qt5

I've followed this article on using OpenGL extensions in Qt5 (reference) and following the example code, I get the following error messages: undefined reference to

QOpenGLExtension_ARB_instanced_arrays::QOpenGLExtension_ARB_instanced_arrays()'
undefined reference to `QOpenGLExtension_ARB_instanced_arrays::initializeOpenGLFunctions()'

I've made sure that I have said extension through m_context->hasExtension(..)

Here's my code block (very similar to the article code):

assert(m_context->hasExtension(QByteArrayLiteral("GL_ARB_instanced_arrays")));
QOpenGLExtension_ARB_instanced_arrays* m_instanceFuncs = new QOpenGLExtension_ARB_instanced_arrays();
m_instanceFuncs->initializeOpenGLFunctions();
qDebug("extension loaded");

I'd assume the article would have mentioned other necessary steps.. I'm using Qt 5.3 on Windows 7 with a 4.3 Core context.

Upvotes: 2

Views: 2526

Answers (1)

Arch
Arch

Reputation: 51

QOpenGLExtensions reside in another submodule than opengl, and so I had to enable it in the pro file like so:

QT += openglextensions

Upvotes: 3

Related Questions