I'm working on a visualization project. It should view a 3d model on a QGLViewer. I have a subclass of QGLViewer defined like this:
class GLViewer : public QGLViewer
{
Q_OBJECT
public:
explicit GLViewer(QWidget *parent = 0,const QGLWidget* shareWidget=0, Qt::WFlags flags=0);
protected:
void initializeGL();
void resizeGL(int width, int height);
void paintGL();
signals:
public slots:
};
Implementing the c’tor like this:
GLViewer::GLViewer(QWidget *parent, const QGLWidget* shareWidget, Qt::WFlags flags):
QGLViewer(parent,shareWidget,flags)
{
}
I’m getting linker error:
glviewer.o: In function `GLViewer::GLViewer(QWidget*, QGLWidget const*, QFlags<Qt::WindowType>)':
glviewer.cpp:(.text+0x18): undefined reference to `vtable for GLViewer'
glviewer.cpp:(.text+0x20): undefined reference to `vtable for GLViewer'
EDIT:
This is content of .pro
file:
QT += core gui opengl xml
TARGET = qglviewer-test
TEMPLATE = app
LIBS += -lqglviewer-qt4 -lGLU -lGLEW
SOURCES += main.cpp\
mainwindow.cpp \
glviewer.cpp
HEADERS += mainwindow.h \
glviewer.cpp
FORMS += mainwindow.ui