Der Wald und die Bäume
Verfasst: 25. November 2006 16:31
Hi,
irgendwie sehe ich wohl den Wald vor Bäumen nicht:
mit
und der Compiler meint:
Wer reisst mir das Brett vor dem Kopf weg?
Vielen Dank
Olaf
irgendwie sehe ich wohl den Wald vor Bäumen nicht:
Code: Alles auswählen
#include <QtGui/QApplication>
#include <QtGui/QMainWindow>
#include <QtDebug>
class Application
: public QApplication
{
Q_OBJECT
public:
Application(int argc, char **argv);
virtual ~Application();
};
Application::Application(int argc, char **argv)
: QApplication(argc, argv)
{
qDebug() << "CTor App";
}
Application::~Application()
{
qDebug() << "DTor App";
}
int main(int argc, char **argv)
{
Application app( argc, argv );
QMainWindow win;
win.show();
return app.exec();
}
Code: Alles auswählen
TEMPLATE = app
TARGET =
DEPENDPATH += .
INCLUDEPATH += .
SOURCES += app.cpp
Code: Alles auswählen
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -I. -o app.o app.cpp
g++ -o qtest app.o -L/usr/lib -lQtGui -lQtCore -lpthread
app.o: In function `Application::Application(int, char**)':
app.cpp:(.text+0x30): undefined reference to `vtable for Application'
app.o: In function `Application::Application(int, char**)':
app.cpp:(.text+0x310): undefined reference to `vtable for Application'
app.o: In function `main':
app.cpp:(.text+0x637): undefined reference to `vtable for Application'
app.cpp:(.text+0x65d): undefined reference to `vtable for Application'
collect2: ld gab 1 als Ende-Status zurück
make: *** [qtest] Fehler 1
Vielen Dank
Olaf