Home > Blockchain >  QOpenGLWidget linker error with QT example code
QOpenGLWidget linker error with QT example code

Time:12-28

after several failed attempts to create a QOpenGLWidget.I tried to run the QT example code https://code.qt.io/cgit/qt/qtbase.git/tree/examples/opengl/2dpainting?h=5.15 But that does not work too. I get the same vtable error as in the previous attempts. Here is the complete error code.

error code

I already reinstalled QT and added

QT  = core gui widgets opengl

LIBS  = -framework OpenGL -framework QtOpenGL -framework GLUT 

to the .pro file

CodePudding user response:

If you use Qt6, then you need to link against openglwidgets.

See https://doc.qt.io/qt-6/qopenglwidget.html

  • Related