Important: Please read the Qt Code of Conduct -

QGLViewer subclass: linker says undefined reference to `vtable of QGLViewer'

  • Hello forum

    I have a subclass of QGLViewer:
    class GLViewer : public QGLViewer
    explicit GLViewer(QWidget parent = 0,const QGLWidget shareWidget=0, Qt::WFlags flags=0);
    void initializeGL();
    void resizeGL(int width, int height);
    void paintGL();
    public slots:

    Implementing the c'tor like this:
    GLViewer::GLViewer(QWidget parent, const QGLWidget shareWidget, Qt::WFlags flags):

    I'm getting linker error:

    glviewer.o: In function GLViewer::GLViewer(QWidget*, QGLWidget const*, QFlags<Qt::WindowType>)': glviewer.cpp:(.text+0x18): undefined reference tovtable for GLViewer'
    glviewer.cpp:(.text+0x20): undefined reference to `vtable for GLViewer'

    Thanks in advance.

  • You enabled the opengl at your pro file?

  • [quote author="GentooXativa" date="1334911842"]You enabled the opengl at your pro file?[/quote]

    @LIBS += -lqglviewer-qt4 -lGLU@
    @QT += core gui opengl xml glviewer@
    Is that correct?

Log in to reply