I got some problems with QOpenGLFunctions_4_1_Core most likely in the version 6.0 in Qt. The QOpenGLFunctions 4.1 function appears not to apply in the call function of the code for some reasons, and prevent the code running at all. In the version 6.0 Qt, I had to call the function <QtOpenGL/QOpenGLFunctions_4_1_Core> to even have the means of calling the code functions of relevant part. Is this the main reason for the error?
//visualobject.h
#ifndef VISUALOBJECT_H
#define VISUALOBJECT_H
#include <QtOpenGL/QOpenGLFunctions_4_1_Core>
#include [...]
class VisualObject: public QOpenGLFunctions_4_1_Core
{
public:
VisualObject();
~VisualObject();
[...]
};
#endif
//visualobject.cpp full code for now
VisualObject::VisualObject()
{
}
VisualObject::~VisualObject()
{
glDeleteVertexArrays(1, &mVAO);
glDeleteBuffers(1, &mVBO);
}
error: undefined reference to
`__imp__ZN25QOpenGLFunctions_4_1_CoreC2Ev' In function
'VisualObject::Visual Object'
error: undefined reference to
`__imp__ZN25QOpenGLFunctions_4_1_CoreC2Ev' In function
'VisualObject::~Visual Object'
error: undefined reference to `QOpenGLFunctions_4_1_Core::initializeOpenGLFunctions()'
question from:
https://stackoverflow.com/questions/65934537/qopenglfunctions-4-1-core-function-error-in-qt-version-6-0 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…