I'm trying to create a OpenGL
widget using Qt 6.4
and VStudio 2022
, i have enable the Qt OpenGL
widget under the modules, but i still getting a lot of compile errors:
LNK2019 unresolved external symbol "__declspec(dllimport) public: __cdecl QOpenGLWidget::QOpenGLWidget(class QWidget *,class QFlags<enum Qt::WindowType>)" (__imp_??0QOpenGLWidget@@QEAA@PEAVQWidget@@V?$QFlags@W4WindowType@Qt@@@@@Z) referenced in function "public: void __cdecl Ui_MainWindowClass::setupUi(class QMainWindow *)" (?setupUi@Ui_MainWindowClass@@QEAAXPEAVQMainWindow@@@Z)
I'm testing in a 'clean' project containing nothing more than a OpenGlWidget
added trough QT Designer.
The includes i have added:
#include <QtWidgets>
#include <QtOpenGL>
My project configuration:
I have also tried adding, into Linker -> General -> Additional Library directories
:
D:\Qt\6.4.0\msvc2019_64\lib;
And at Linker -> Input -> Additional Dependencies
:
Qt6OpenGL.lib
But i continue getting the same errors.
I have installed everything in the Qt Maintenance tool
, what i'm missing?
QOpenGLWidget
has been moved to Qt OpenGL Widgets module. You must to link against bothQt6OpenGL.lib
andQt6OpenGLWidget.lib
.https://doc.qt.io/qt-6/opengl-changes-qt6.html#the-qopenglwidgets-class