磕头作揖了,请您无比帮帮忙啊
main.cpp
#include <kcmdlineargs.h>
#include <kaboutdata.h>
#include <klocale.h>
#include "hello.h"
static const char *description =
I18N_NOOP("Hello");
static KCmdLineOptions options[] ={{ 0, 0, 0 }};
int main(int argc, char *argv[]){
KAboutData aboutData( "hello", I18N_NOOP("Hello"),
VERSION, description, KAboutData::License_GPL,
"(c) 2003, ", 0, 0, "");
aboutData.addAuthor("",0, "");
KCmdLineArgs::init( argc, argv, &aboutData );
KCmdLineArgs::addCmdLineOptions( options ); // Add our own options.
KApplication a;
Hello *hello = new Hello();
a.setMainWidget(hello);
hello->show();
return a.exec();
}
hello.h
#ifndef HELLO_H
#define HELLO_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <kapp.h>
#include <qwidget.h>
class Hello : public QWidget{
Q_OBJECT
public:
Hello(QWidget* parent=0, const char *name=0);
~Hello();
};
#endif
hello.cpp
#include "hello.h"
Hello::Hello(QWidget *parent, const char *name) : QWidget(parent, name){}
Hello::~Hello(){}
这段代码是我kdevelop自动生成的,我没有做丝毫改动,但make的时候就出现了
“undefined reference to "vtable for helloapp"
请问这是怎么回事啊?
另外我想知道Hello类中的Q_OBJECT应该怎么理解啊?千恩万谢谢!
问题点数:0、回复次数:4Top
1 楼fierygnu(va_list)回复于 2003-08-03 08:29:18 得分 0
这样试一下:
Hello *hello = new Hello();-》
QWidget *hello = new QWidget();Top
2 楼fyss(风云书生)回复于 2003-08-03 09:50:21 得分 0
我的KDEDoc没有找到有没有关系啊?如果有的话,能不能给个详细地址去下载啊,谢谢Top
3 楼fierygnu(va_list)回复于 2003-08-03 10:38:24 得分 0
跟KDEDoc有没有没关系。Top
4 楼fyss(风云书生)回复于 2003-08-03 11:16:44 得分 0
哥哥,有还是没有啊Top



