Problems when trying to compile cpp files using qt headers
Hello. I have mandrake 9.1. I've tried to use qt assistant to learn gui programming (at least to see what it is). I have done everything exactly as it was written in the tutorial #1 of the qt assistant. But when i try to compile the file HelloWorld.cpp using make or g++ there are lots of errors saying about undefined references. What's wrong? Thanks in advance.
Here are the messages produced:
[blade@localhost qt]$ qmake -project
[blade@localhost qt]$ qmake
[blade@localhost qt]$ make
g++ -o qt qt.o -L/usr/X11R6/lib -lXext -lX11 -lm
qt.o(.text+0x30): In function `main':
: undefined reference to `QApplication::QApplication[in-charge](int&, char**)'
qt.o(.text+0x40): In function `main':
: undefined reference to `QString::QString[in-charge](char const*)'
qt.o(.text+0x62): In function `main':
: undefined reference to `QPushButton::QPushButton[in-charge](QString const&, QWidget*, char const*)'
qt.o(.text+0x7d): In function `main':
: undefined reference to `QString::shared_null'
qt.o(.text+0x87): In function `main':
: undefined reference to `QStringData::deleteSelf()'
qt.o(.text+0xa4): In function `main':
: undefined reference to `QPushButton::resize(int, int)'
qt.o(.text+0xb0): In function `main':
: undefined reference to `QApplication::setMainWidget(QWidget*)'
qt.o(.text+0xb8): In function `main':
: undefined reference to `QWidget::show()'
qt.o(.text+0xc0): In function `main':
: undefined reference to `QApplication::exec()'
qt.o(.text+0xca): In function `main':
: undefined reference to `QPushButton::~QPushButton [in-charge]()'
qt.o(.text+0xd2): In function `main':
: undefined reference to `QApplication::~QApplication [in-charge]()'
qt.o(.text+0xfe): In function `main':
: undefined reference to `QString::shared_null'
qt.o(.text+0x108): In function `main':
: undefined reference to `QStringData::deleteSelf()'
qt.o(.text+0x116): In function `main':
: undefined reference to `QPushButton::~QPushButton [in-charge]()'
qt.o(.text+0x126): In function `main':
: undefined reference to `QApplication::~QApplication [in-charge]()'
collect2: ld returned 1 exit status
make: *** [qt] Error 1
Report this pos
|