Sorry if this is a very basic question, but I'm confused:
I'm using Visual Studio and I'm creating a custom QOpenGLWidget
class (by inheriting from the base class), and my problem is as follows:
- If I add
#include <QOpenGLWidget>
in my custom class, and also add the#include
forglew.h
, I can access the things defined inglew.h
- But If I add
#include <QtWidgets>
in my custom class (which I though would coverQOpenGLWidget
too), then I can't access what is defined inglew.h
and I see "identifier not defined" errors (for example, forglGenVertexArrays
)
Can someone please tell me what I'm missing here? I'm guessing that including what I only need (#include <QOpenGLWidget>
) is better than a whole lot of stuff in <QtWidgets>
, but why should it prevent me from accessing what is defined in glew.h
?
Any help is appreciated