Hi all, I've just started using qt and I've run into the problem of constantly getting
undefined reference to 'vtable for window'
Witch is strange cause I was able to run some of the tutorial examples but this one just wont work.
I'm using Kdevelop 3.5 on ubuntu 7.04 and using qt4
window.h
window.cppCode:
/*************************************************************************** * Copyright (C) 2007 by adriaan,,, * * adriaan@Tornado * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #pragma once #include <QApplication> #include <QtGui> #include <QWidget> #include <QComboBox> #include <QLineEdit> #include <QtGui> #include <QGridLayout> #include <QGroupBox> #include <QPushButton> #include <QLabel> { public: ~window(); private: QLineEdit * nameline; QLineEdit * typeline; QLineEdit * answerline; };
main.cppCode:
/*************************************************************************** * Copyright (C) 2007 by adriaan,,, * * adriaan@Tornado * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include "window.h" { /*================================================= * Settings * =================================================*/ setWindowTitle("Variable Definer Version 0.1"); /*================================================= * Name * =================================================*/ nameline->setFocus(); namelayout->addWidget(namelabel, 0, 0); namelayout->addWidget(nameline, 1, 0,1,2); namegroup->setLayout(namelayout); /*================================================= * Type * =================================================*/ typelayout->addWidget(typeLabel, 0, 0); typelayout->addWidget(typeline, 1,0,1,2); typegroup->setLayout(typelayout); /*================================================= * Specifiers * =================================================*/ speclay->addWidget(speclabel,0,0); speclay->addWidget(array,1,0); speclay->addWidget(pointer,1,1); speclay->addWidget(function,1,2); specgroup->setLayout(speclay); /*================================================= * Answer * =================================================*/ anslay->addWidget(answerlabel,0,0); anslay->addWidget(answerline,1,0,1,2); answergroup->setLayout(anslay); /*================================================= * Global Layout * =================================================*/ layout->addWidget(namegroup, 0, 0); layout->addWidget(typegroup, 1, 0); layout->addWidget(specgroup, 2, 0); layout->addWidget(answergroup,3, 0); setLayout(layout); }
Code:
/*************************************************************************** * Copyright (C) 2007 by adriaan,,, * * adriaan@Tornado * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include <QApplication> #include "window.h" int main(int argc, char *argv[]) { window * newwindow = new window(); newwindow->show(); return (application.exec()); }