Results 1 to 8 of 8

Thread: #include <QApplication> undefined reference to vtable

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2007
    Posts
    8
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    2

    Default Re: #include <QApplication> undefined reference to vtable

    I' ve encountered this problem once again while trying to create a signal and slot
    and yes all functions are stated in window.cpp

    window.h
    Qt Code:
    1. /***************************************************************************
    2.  * Copyright (C) 2007 by adriaan,,, *
    3.  * adriaan@Tornado *
    4.  * *
    5.  * This program is free software; you can redistribute it and/or modify *
    6.  * it under the terms of the GNU General Public License as published by *
    7.  * the Free Software Foundation; either version 2 of the License, or *
    8.  * (at your option) any later version. *
    9.  * *
    10.  * This program is distributed in the hope that it will be useful, *
    11.  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
    12.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
    13.  * GNU General Public License for more details. *
    14.  * *
    15.  * You should have received a copy of the GNU General Public License *
    16.  * along with this program; if not, write to the *
    17.  * Free Software Foundation, Inc., *
    18.  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
    19.  ***************************************************************************/
    20.  
    21. #pragma once
    22.  
    23. #include <QApplication>
    24. #include <QtGui>
    25. #include <QWidget>
    26. #include <QObject>
    27. #include <QComboBox>
    28. #include <QLineEdit>
    29. #include <QtGui>
    30. #include <QGridLayout>
    31. #include <QGroupBox>
    32. #include <QPushButton>
    33. #include <QLabel>
    34.  
    35.  
    36. class window : public QWidget
    37. {
    38.  
    39. Q_OBJECT
    40.  
    41. public:
    42.  
    43. window(QWidget * parent = NULL);
    44.  
    45. ~window();
    46.  
    47.  
    48. public slots:
    49.  
    50. void select(int choice);
    51.  
    52.  
    53. signals:
    54.  
    55. void createanswer(int al);
    56.  
    57.  
    58. private:
    59.  
    60. QLineEdit * nameline;
    61.  
    62. QLineEdit * typeline;
    63.  
    64. QLineEdit * answerline;
    65.  
    66. };
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts

    Default Re: #include <QApplication> undefined reference to vtable

    Make sure window.h is listed in .pro file and then try re-running qmake. In general, you should always re-run qmake after adding Q_OBJECT macro so that required make rules for moc get generated.
    J-P Nurmi

  3. #3
    Join Date
    Sep 2007
    Posts
    8
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    2

    Default Re: #include <QApplication> undefined reference to vtable

    It seems to be in there but no moc files are created when compiling and thats probably the problem but I have no idea of how to fix this.
    It's probably something Kdevelop related.

  4. #4
    Join Date
    Jan 2006
    Location
    Kerala
    Posts
    371
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    76
    Thanked 37 Times in 32 Posts

    Default Re: #include <QApplication>

    if no moc files are created then, run a qmake. ( just a jpn had mentioned )
    We can't solve problems by using the same kind of thinking we used when we created them

  5. #5
    Join Date
    Jul 2007
    Posts
    26
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default Re: #include <QApplication> undefined reference to vtable

    You need to rebuild your app from scratch.
    I mean, recompile, not delete your work and start over

    just run:
    make distclean
    qmake
    make

Similar Threads

  1. please help with linker errors
    By jimboqt in forum Qt Programming
    Replies: 1
    Last Post: 5th July 2007, 10:49
  2. error undefined reference ...............
    By amit_pansuria in forum Qt Programming
    Replies: 2
    Last Post: 8th June 2007, 15:28
  3. how to correctly compile threads support?
    By srhlefty in forum Installation and Deployment
    Replies: 9
    Last Post: 25th June 2006, 20:15
  4. Strange error while using Q3Canvas
    By Kapil in forum Newbie
    Replies: 13
    Last Post: 15th June 2006, 20:36
  5. linking user space and kernel space programs with qmake
    By zielchri in forum Qt Programming
    Replies: 9
    Last Post: 9th March 2006, 00:11

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.