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. Undefined reference to vtable
Forum Updated to NodeBB v4.3 + New Features

Undefined reference to vtable

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 4 Posters 1.3k Views 3 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.
  • C Offline
    C Offline
    cprogcoder
    wrote on last edited by
    #1

    Hello,

    I added a form named "Suchen" and declared it in the suchen.h & suchen.cpp files.
    During the compiling I have become a failure which I couldnt understand.
    I added the "suchen.h" and suchen.cpp files. Do someone have an idea ?

    Thanks,

    the header file :

    #ifndef SUCHEN_H
    #define SUCHEN_H
    
    #include <QtSql>
    #include <QtGui>
    #include <QDialog>
    
    
    namespace Ui {
    class Suchen;
    }
    
    class Suchen : public QDialog
    {
        Q_OBJECT
    
    public:
        explicit Suchen(QWidget *parent = 0);
        ~Suchen();
    
    
    
    public:
          //void suchenliste();
          bool dbVerbinden();
    
    public:
          QString sqlAbfrage;
          QString suchen1;
    
    
    private slots:
        void on_SucheStart_clicked();
        void on_SucheBeenden_clicked();
    
    
    private:
        Ui::Suchen *ui;
    
        //steht die Verbindung zur Datenbank?
        bool dbVerbunden;
    
        //für die Datenbank
        QSqlDatabase datenbank;
    
    };
    
    
    
    #endif // SUCHEN_H
    
    

    the cpp file :

    #include "suchen.h"
    #include "ui_suchen.h"
    //#include "suchenliste.h"
    
    
    #include <QtSql>
    #include <QTableView>
    #include <QMessageBox>
    #include <QInputDialog>
    
    //der Konstruktor
    //er verbindet das Formular mit der Oberfläche und stellt die Verbindungen her
    
    
    Suchen::Suchen(QWidget *parent) :
        QDialog(parent),
        ui(new Ui::Suchen)
    {
        ui->setupUi(this);
        //dbVerbunden = dbVerbinden();
    }
    
    
    
    Suchen::~Suchen()
    {
        delete ui;
    }
    
    
    
    1 Reply Last reply
    0
    • M Offline
      M Offline
      mostefa
      wrote on last edited by mostefa
      #2

      @cprogcoder said in Undefined reference to vtable:

      private slots:
      void on_SucheStart_clicked();
      void on_SucheBeenden_clicked();

      Hi @cprogcoder

      The cause of your problem is that you did not add definition of your slots on your cpp files

      private slots:
          void on_SucheStart_clicked();
          void on_SucheBeenden_clicked();
      

      this should solve the problem:

      void Suchen::on_SucheStart_clicked()
      {
      
      }
      
      void Suchen::on_SucheBeenden_clicked()
      {
      
      }
      

      I hope this can help you !

      1 Reply Last reply
      2
      • mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by mrjj
        #3

        Hi
        Clean the build folder (delete it)
        run qmake
        and rebuild all and it should work.

        @mostefa
        Good catch. completely missed that.

        1 Reply Last reply
        2
        • C Offline
          C Offline
          cprogcoder
          wrote on last edited by
          #4

          Hello,
          I tried the suggestions, now it works fine.
          Thank you in advance,

          ? 1 Reply Last reply
          0
          • C cprogcoder

            Hello,
            I tried the suggestions, now it works fine.
            Thank you in advance,

            ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            @cprogcoder Please use the button "Topic Tools" and mark this thread as solved.

            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