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



  • Hello forum

    I have a subclass of QGLViewer:
    @
    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 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@
    and
    @QT += core gui opengl xml glviewer@
    Is that correct?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.