Results 1 to 20 of 24

Thread: Error : undefined reference to `vtable for MyClass'

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Posts
    157
    Thanks
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4

    Default Error : undefined reference to `vtable for MyClass'

    hi guys,

    While compiling at the time of linking , am getting the error : undefined reference to `vtable for ChemHeaderFooterOptions'




    see .pro file
    Qt Code:
    1. TEMPLATE = app
    2. LANGUAGE = C++
    3.  
    4. CONFIG += qt warn_on debug
    5.  
    6. unix:LIBS += -lXext -lm
    7.  
    8. DEFINES += SYNSUP_GUI
    9.  
    10. QT += qt3support
    11.  
    12. INCLUDEPATH += . ./common
    13. unix:MOC_DIR += ../source/linuxmoc
    14. unix:OBJECTS_DIR += ../source/linuxobj
    15. win32:MOC_DIR += ../source/Winmoc
    16. win32:OBJECTS_DIR += ../source/Winobj
    17. unix:UI_HEADERS_DIR = ../source/dlg
    18. win32:UI_HEADERS_DIR = ../source/dlg
    19. unix:UI_SOURCES_DIR = ../source/dlg
    20. win32:UI_SOURCES_DIR = ../source/dlg
    21.  
    22. HEADERS += atomgroup.h \
    23. atomicnumber.h \
    24. canonlist.h \
    25. chemcanvas.h \
    26. chemedit.h \
    27. chemenums.h \
    28. chemglobals.h \
    29. chemicons.h \
    30. chemmap.h \
    31. chemobj.h \
    32. chemstate.h \
    33. chemstructs.h \
    34. chemtree.h \
    35. chemtreecanvas.h \
    36. chemutils.h \
    37. common/atomarray.h \
    38. common/rownumberarray.h \
    39. common/alist.h \
    40. common/atom.h \
    41. common/atominring.h \
    42. common/atompair.h \
    43. common/availmol.h \
    44. common/basefragment.h \
    45. common/basemolecule.h \
    46. common/commondec.h \
    47. common/fglist.h \
    48. common/integerlist.h \
    49. common/nbrlist.h \
    50. common/ring.h \
    51. common/ringpair.h \
    52. common/synsupmatrix.h \
    53. common/synsupvector.h \
    54. common/twoatomsinring.h \
    55. common/utils.h \
    56. coord.h \
    57. ct.h \
    58. datom.h \
    59. dbond.h \
    60. dgroup.h \
    61. dlg/AtomPropertiesDlg.h \
    62. dlg/BondPropertiesDlg.h \
    63. dlg/BondPropertiesDlgData.h \
    64. dlg/CmbeditInfo.h \
    65. dlg/CanvasPaperDlg.h \
    66. dlg/Functionalgrouplimitdlg.h \
    67. dlg/HeaderFooterInfoDlg.h \
    68. dlg/MySpinBox.h \
    69. dlg/PageSetupDlg.h \
    70. dlg/ServerPreferences.h \
    71. dlg/SynsupMail.h \
    72. dlg/SynsupOptionsDlg.h \
    73. dlg/SynsupOptionsDlgData.h \
    74. dlg/SynViewerPropertyDlg.h \
    75. dlg/ViewPreferences.h \
    76. dmolecule.h \
    77. dreaction.h \
    78. dring.h \
    79. droute.h \
    80. dsymbol.h \
    81. dtext.h \
    82. elemchooser.h \
    83. fontchooser.h \
    84. headerAndFooterFormatter.h \
    85. headerFooterOptions.h \
    86. mappings.h \
    87. molproperty.h \
    88. route.h \
    89. scrollchemcanvas.h \
    90. smtp.h \
    91. showToolTip.h \
    92. synViewerproperty.h \
    93. synsupoptions.h \
    94. templatechooser.h \
    95. wcpoint.h \
    96. zoomer.h
    97.  
    98. SOURCES += atomgroup.cpp \
    99. chemcanvas.cpp \
    100. chemedit.cpp \
    101. chemglobals.cpp \
    102. chemicons.cpp \
    103. chemmap.cpp \
    104. chemobj.cpp \
    105. chemstate.cpp \
    106. chemtree.cpp \
    107. chemtreecanvas.cpp \
    108. chemutils.cpp \
    109. common/rownumberarray.cpp \
    110. common/alist.cpp \
    111. common/atom.cpp \
    112. common/atominring.cpp \
    113. common/atompair.cpp \
    114. common/basefragment.cpp \
    115. common/basemolecule.cpp \
    116. common/basestereo.cpp \
    117. common/canon.cpp \
    118. common/fglist.cpp \
    119. common/integerlist.cpp \
    120. common/nbrlist.cpp \
    121. common/ring.cpp \
    122. common/ringpair.cpp \
    123. common/rings.cpp \
    124. common/twoatomsinring.cpp \
    125. common/utils.cpp \
    126. coord.cpp \
    127. ct.cpp \
    128. datom.cpp \
    129. dbond.cpp \
    130. dgroup.cpp \
    131. dlg/AtomPropertiesDlg.cpp \
    132. dlg/BondPropertiesDlg.cpp \
    133. dlg/BondPropertiesDlgData.cpp \
    134. dlg/CmbeditInfo.cpp \
    135. dlg/CanvasPaperDlg.cpp \
    136. dlg/Functionalgrouplimitdlg.cpp \
    137. dlg/HeaderFooterInfoDlg.cpp \
    138. dlg/MySpinBox.cpp\
    139. dlg/PageSetupDlg.cpp \
    140. dlg/ServerPreferences.cpp \
    141. dlg/SynsupMail.cpp \
    142. dlg/SynsupOptionsDlg.cpp \
    143. dlg/SynsupOptionsDlgData.cpp \
    144. dlg/SynViewerPropertyDlg.cpp \
    145. dlg/ViewPreferences.cpp \
    146. dmolecule.cpp \
    147. dreaction.cpp \
    148. dring.cpp \
    149. droute.cpp \
    150. dsymbol.cpp \
    151. dtext.cpp \
    152. elemchooser.cpp \
    153. fontchooser.cpp \
    154. headerAndFooterFormatter.cpp \
    155. headerFooterOptions.cpp \
    156. main.cpp \
    157. mappings.cpp \
    158. molproperty.cpp \
    159. ncoord.cpp \
    160. route.cpp \
    161. scrollchemcanvas.cpp \
    162. synViewerproperty.cpp \
    163. smtp.cpp \
    164. ShowToolTip.cpp \
    165. synsupoptions.cpp \
    166. templatechooser.cpp \
    167. zoomer.cpp
    168.  
    169. FORMS += dlg/SynsupMailDlg.ui \
    170. dlg/Functionalgrouplimitdlg.ui \
    171. dlg/PageSetupDlg.ui \
    172. dlg/ServerPreferencesDlg.ui \
    173. dlg/AtomPropertiesDlgData.ui \
    174. dlg/SynsupOptionsDlgData.ui \
    175. dlg/SynViewerPropertyDlg.ui \
    176. dlg/HeaderFooterInfoDlg.ui \
    177. dlg/ViewPreferencesDlg.ui \
    178. dlg/InfoDlg.ui \
    179.  
    180.  
    181.  
    182. win32:TMAKE_CFLAGS = -TP
    183. win32:TMAKE_CXXFLAGS = -GX
    184. win32:RC_FILE = chemedit.rc
    185. CONFIG += non_threaded
    186. TARGET = cmbedit
    187. TRANSLATIONS = chemedit_en.ts \
    188. chemedit_jp.ts
    189. #The following line was inserted by qt3to4
    190. QT +=
    To copy to clipboard, switch view to plain text mode 

    See .h file

    Qt Code:
    1. #ifndef _ChemHeaderFooterOptions_
    2.  
    3. #define _ChemHeaderFooterOptions_
    4.  
    5.  
    6.  
    7. #include <q3hbox.h>
    8.  
    9. #include <q3popupmenu.h>
    10.  
    11. #include <qpushbutton.h>
    12.  
    13. #include <q3mainwindow.h>
    14.  
    15. #include <qstring.h>
    16.  
    17. #include <qtoolbutton.h>
    18.  
    19. #include <q3toolbar.h>
    20.  
    21. #include <qtooltip.h>
    22.  
    23. #include "chemtree.h"
    24.  
    25. #include "headerAndFooterFormatter.h"
    26.  
    27.  
    28. class ChemHeaderFooterOptions:public Q3ToolBar
    29.  
    30. {
    31.  
    32. Q_OBJECT
    33.  
    34. public:
    35. // Constructor
    36. ChemHeaderFooterOptions(ChemTree::SynViewMode synViewMode, Q3MainWindow *parent = 0, char *name = "",
    37.  
    38. ChemCanvas *canvas = 0 );
    39.  
    40.  
    41.  
    42. public slots:
    43. void closeFormater();
    44.  
    45. protected slots:
    46.  
    47. private:
    48.  
    49. };
    50. #endif
    To copy to clipboard, switch view to plain text mode 

    See the .cpp file below
    Qt Code:
    1. //constructor. Here is the error [ undefined refernce to vtable ...] points ,
    2.  
    3. ChemHeaderFooterOptions::ChemHeaderFooterOptions(ChemTree::SynViewMode synViewMode, Q3MainWindow *parent, char *name, ChemCanvas *canvas)
    4. :Q3ToolBar(parent, name)
    5.  
    6. {
    7. // some normal coding
    8. }
    To copy to clipboard, switch view to plain text mode 

    See the Error : that i have received while linking
    Qt Code:
    1. /root/Desktop/June12porting_to_Qt4/source/headerFooterOptions.cpp:26: undefined reference to `vtable for ChemHeaderFooterOptions'
    2. ../source/linuxobj/headerFooterOptions.o(.text+0xba):/root/Desktop/June12porting_to_Qt4/source/headerFooterOptions.cpp:26: undefined reference to `vtable for ChemHeaderFooterOptions'
    3. /root/Desktop/June12porting_to_Qt4/source/headerFooterOptions.cpp:26: undefined reference to `vtable for ChemHeaderFooterOptions'
    4. ../source/linuxobj/headerFooterOptions.o(.text+0x18dc):/root/Desktop/June12porting_to_Qt4/source/headerFooterOptions.cpp:26: undefined reference to `vtable for ChemHeaderFooterOptions'
    5. *** Exited with status: 2 ***
    To copy to clipboard, switch view to plain text mode 


    What i did so far :--

    1) . I included the files in .pro files properly
    2). cleared the .obj && moc files.
    3) then rebuild the porject


    After all my attempts i am getting the same error.
    Please help me.
    Thanks
    Last edited by joseph; 13th June 2007 at 11:21.

Similar Threads

  1. error undefined reference ...............
    By amit_pansuria in forum Qt Programming
    Replies: 2
    Last Post: 8th June 2007, 14:28
  2. how to correctly compile threads support?
    By srhlefty in forum Installation and Deployment
    Replies: 9
    Last Post: 25th June 2006, 19:15
  3. Strange error while using Q3Canvas
    By Kapil in forum Newbie
    Replies: 13
    Last Post: 15th June 2006, 19:36
  4. linking user space and kernel space programs with qmake
    By zielchri in forum Qt Programming
    Replies: 9
    Last Post: 8th March 2006, 23:11
  5. Linker Errors
    By MarkoSan in forum Qt Programming
    Replies: 5
    Last Post: 7th March 2006, 18:30

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.