Habe eben versucht folgendes Programm zu compilieren:
Der Compileraufruf erfolgte mit:
Ich erhielt folgende Fehlermeldungen:
Was habe ich vergessen/falsch gemacht?
Code:
#include <qapplication.h>
#include <qlabel.h>
int main( int argc, char* argv[])
{
QApplication myapp( argc, argv );
QLabel* mylabel = new QLabel( "Hello world", 0 );
mylabel->resize( 120, 30 );
myapp.setMainWidget( mylabel );
mylabel->show();
return myapp.exec();
}
Der Compileraufruf erfolgte mit:
Code:
g++ -I/usr/lib/qt3/include -L/usr/lib/qt3/lib -lqt -o hello hello.cpp
Ich erhielt folgende Fehlermeldungen:
Code:
/tmp/ccQUHyrT.o: In function `main':
hello.cpp:(.text+0x24): undefined reference to `QApplication::QApplicatio
n(int&, char**)'
hello.cpp:(.text+0x37): undefined reference to `QString::QString(char con
st*)'
hello.cpp:(.text+0x76): undefined reference to `QLabel::QLabel(QString co
nst&, QWidget*, char const*, unsigned int)'
hello.cpp:(.text+0xeb): undefined reference to `QApplication::setMainWidg
et(QWidget*)'
hello.cpp:(.text+0x10a): undefined reference to `QApplication::exec()'
hello.cpp:(.text+0x117): undefined reference to `QApplication::~QApplicat
ion()'
hello.cpp:(.text+0x12d): undefined reference to `QApplication::~QApplicat
ion()'
/tmp/ccQUHyrT.o: In function `QString::~QString()':
hello.cpp:(.text._ZN7QStringD1Ev[QString::~QString()]+0x1d): undefined re
ference to `QString::shared_null'
hello.cpp:(.text._ZN7QStringD1Ev[QString::~QString()]+0x2e): undefined re
ference to `QStringData::deleteSelf()'
/tmp/ccQUHyrT.o:(.rodata._ZTV6QGList[vtable for QGList]+0xc): undefined r eference to `QGList::clear()'
/tmp/ccQUHyrT.o:(.rodata._ZTV6QGList[vtable for QGList]+0x10): undefined reference to `QGList::~QGList()'
/tmp/ccQUHyrT.o:(.rodata._ZTV6QGList[vtable for QGList]+0x14): undefined reference to `QGList::~QGList()'
/tmp/ccQUHyrT.o:(.rodata._ZTV6QGList[vtable for QGList]+0x18): undefined reference to `QPtrCollection::newItem(void*)'
/tmp/ccQUHyrT.o:(.rodata._ZTV6QGList[vtable for QGList]+0x20): undefined reference to `QGList::compareItems(void*, void*)'
/tmp/ccQUHyrT.o:(.rodata._ZTV6QGList[vtable for QGList]+0x24): undefined reference to `QGList::read(QDataStream&, void*&)'
/tmp/ccQUHyrT.o:(.rodata._ZTV6QGList[vtable for QGList]+0x28): undefined reference to `QGList::write(QDataStream&, void*) const'
/tmp/ccQUHyrT.o:(.rodata._ZTI6QGList[typeinfo for QGList]+0x8): undefined reference to `typeinfo for QPtrCollection'
collect2: ld gab 1 als Ende-Status zurück
Was habe ich vergessen/falsch gemacht?