Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QGLViewer subclass: linker says undefined reference to `vtable of QGLViewer'
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 2.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    soroush
    wrote on last edited by
    #1

    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 to vtable for GLViewer'
    glviewer.cpp:(.text+0x20): undefined reference to `vtable for GLViewer'
    @

    Thanks in advance.

    1 Reply Last reply
    0
    • G Offline
      G Offline
      GentooXativa
      wrote on last edited by
      #2

      You enabled the opengl at your pro file?

      Jose Vicente Giner Sanchez - Senior Mobile Developer

      www.gigigo.com

      C/ Dr. Zamenhof 36bis, 1ºA 28027 Madrid
      T: +34 917431436

      1 Reply Last reply
      0
      • S Offline
        S Offline
        soroush
        wrote on last edited by
        #3

        [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?

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved