phucket_20
July 17th, 2002, 11:09 AM
Hello,
For some reason I can't get my program to compile, I hope maybe someone intelligent can figure this out.
I am running Mandrake 8.2, gcc 3.0.3, and qt 3.0.4, and attempting to compile a QT app using a custom slot. I've been compiling QT apps all day with no problem, but as soon as i define my own slot and hit moc it blows up. This is what I have.
frmMain.h: ( a class declaration file )
#ifndef FRMMAIN_H
#define FRMMAIN_H
#include <qwidget.h>
class frmMain : public QWidget {
Q_OBJECT
public:
frmMain();
public slots:
void MyCustomSlot()
};
#endif
frmMain.cpp ( the cooresponding class definition file )
#include "frmMain.moc"
frmMain::frmMain() {
// default constructor
}
void frmMain::MyCustomSlot() {
exit(1);
}
now.. regardless of what this class necessarily does, i can't get it to compile. first.. i moc'd my header file
moc frmMain.h -o frmMain.moc
No problems.. then i go to compile the cpp into an o:
g++ -I$QTDIR/include -c frmMain.cpp
That's where I get errors. $QTDIR is correct, so my include path points to the right place, but the errors that it spits out (which is about half a page, but to name just a few are )
"In file included from frmMain.cpp
frmMain.moc:30: no 'void frmMain::initMetaObject()' member function declared in class frmMain
frmMain.moc: In member function 'void frmMain::initMetaObject':
frmMain.moc:34: 'badSuperClassWarning' undeclared ( first use in this function )"
it goes on to tell me things like "prototype for QString frmMain::tr(const char*) does not match any in class frmMain", "In static member function 'static QMetaObject* frmMain::staticMetaObject()': no method QMetaObject::new_metadata(), no method QMetaObject::new_metaaccess, struct QMetaData has no member named 'ptr', 'QMember' undeclared" etc etc for a bit.
Can anyone tell me what they think I could be doing wrong? Perhaps I need to reset some environment library variable or something? From the looks of it I think it's not getting something included right, but I'm not sure.
Any help is appreciated. Thank you!
For some reason I can't get my program to compile, I hope maybe someone intelligent can figure this out.
I am running Mandrake 8.2, gcc 3.0.3, and qt 3.0.4, and attempting to compile a QT app using a custom slot. I've been compiling QT apps all day with no problem, but as soon as i define my own slot and hit moc it blows up. This is what I have.
frmMain.h: ( a class declaration file )
#ifndef FRMMAIN_H
#define FRMMAIN_H
#include <qwidget.h>
class frmMain : public QWidget {
Q_OBJECT
public:
frmMain();
public slots:
void MyCustomSlot()
};
#endif
frmMain.cpp ( the cooresponding class definition file )
#include "frmMain.moc"
frmMain::frmMain() {
// default constructor
}
void frmMain::MyCustomSlot() {
exit(1);
}
now.. regardless of what this class necessarily does, i can't get it to compile. first.. i moc'd my header file
moc frmMain.h -o frmMain.moc
No problems.. then i go to compile the cpp into an o:
g++ -I$QTDIR/include -c frmMain.cpp
That's where I get errors. $QTDIR is correct, so my include path points to the right place, but the errors that it spits out (which is about half a page, but to name just a few are )
"In file included from frmMain.cpp
frmMain.moc:30: no 'void frmMain::initMetaObject()' member function declared in class frmMain
frmMain.moc: In member function 'void frmMain::initMetaObject':
frmMain.moc:34: 'badSuperClassWarning' undeclared ( first use in this function )"
it goes on to tell me things like "prototype for QString frmMain::tr(const char*) does not match any in class frmMain", "In static member function 'static QMetaObject* frmMain::staticMetaObject()': no method QMetaObject::new_metadata(), no method QMetaObject::new_metaaccess, struct QMetaData has no member named 'ptr', 'QMember' undeclared" etc etc for a bit.
Can anyone tell me what they think I could be doing wrong? Perhaps I need to reset some environment library variable or something? From the looks of it I think it's not getting something included right, but I'm not sure.
Any help is appreciated. Thank you!