Hi,

I have a problem compiling my first "Hello World" program with qmake. I am using QT 3.3.4 with Debian Sarge and gcc 3.3.5. I first compiled the Qt-Tutorial 1 from the Trolltech website by directly calling gcc without any problems:

Qt Code:
  1. gcc -o qt1 main.cpp -I$QTDIR/include -L$QTDIR/lib -lqt-mt
To copy to clipboard, switch view to plain text mode 

Next I wanted to follow the direction from the tutorial and use qmake:

Qt Code:
  1. qmake -project
  2. qmake
  3. make
To copy to clipboard, switch view to plain text mode 

The last call to make gave me a long list of errors:
Qt Code:
  1. g++ -o qt main.o -L/usr/X11R6/lib -lXext -lX11 -lm
  2. main.o(.text+0x30): In function `main':
  3. : undefined reference to `QApplication::QApplication[in-charge](int&, char**)'
  4. main.o(.text+0x41): In function `main':
  5. : undefined reference to `QString::QString[in-charge](char const*)'
  6. main.o(.text+0x5f): In function `main':
  7. : undefined reference to `QPushButton::QPushButton[in-charge](QString const&, QWidget*, char const*)'
  8. main.o(.text+0x74): In function `main':
  9. : undefined reference to `QString::shared_null'
  10. main.o(.text+0x7e): In function `main':
  11. : undefined reference to `QStringData::deleteSelf()'
  12. main.o(.text+0xa6): In function `main':
  13. : undefined reference to `QPushButton::resize(int, int)'
  14. main.o(.text+0xb2): In function `main':
  15. : undefined reference to `QApplication::setMainWidget(QWidget*)'
  16. main.o(.text+0xba): In function `main':
  17. : undefined reference to `QWidget::show()'
  18. main.o(.text+0xc2): In function `main':
  19. : undefined reference to `QApplication::exec()'
  20. main.o(.text+0xcc): In function `main':
  21. : undefined reference to `QPushButton::~QPushButton [in-charge]()'
  22. main.o(.text+0xd4): In function `main':
  23. : undefined reference to `QApplication::~QApplication [in-charge]()'
  24. ...
To copy to clipboard, switch view to plain text mode 

What makes me suspicious is the first line containing a call to gcc, using X11 libraries and not Qt libraries...