OS: Ubuntu Linux 8.10 x64

QT version: 4.4.3

The code:

Qt Code:
  1. #include <QApplication>
  2. #include <QHttp>
  3. #include <QString>
  4.  
  5. #include <iostream>
  6.  
  7. class Test: public QObject
  8. {
  9. Q_OBJECT
  10.  
  11. QHttp objQHttp;
  12.  
  13. public:
  14.  
  15. Test(QObject *parent= 0): QObject(parent), objQHttp("ftp.otenet.gr")
  16. {
  17. connect(&objQHttp, SIGNAL(dataReadProgress(int, int)), this, SLOT(DisplayProgress(int, int)));
  18.  
  19. objQHttp.get("/linux/ubuntu-releases/intrepid/ubuntu-8.10-desktop-amd64.iso");
  20. }
  21.  
  22.  
  23. private slots:
  24. void DisplayProgress(int done, int total)
  25. {
  26. std::cout<< done<< " of "<< total<< " has been downloaded so far\n";
  27. }
  28. };
  29.  
  30.  
  31. int main(int argc, char *argv[])
  32. {
  33. QApplication app(argc, argv);
  34.  
  35. Test obj(0);
  36.  
  37. app.exec();
  38.  
  39. return 0;
  40. }
To copy to clipboard, switch view to plain text mode 

with QT+= network added in the .pro file, produces:

Qt Code:
  1. john@ubuntu:~/Projects/qt/test$ make
  2. g++ -Wl,--no-undefined -o test main.o -L/usr/lib -lQtGui -lQtNetwork -lQtCore -lpthread
  3. main.o: In function `main':
  4. main.cpp:(.text+0x77): undefined reference to `vtable for Test'
  5. main.cpp:(.text+0x117): undefined reference to `vtable for Test'
  6. main.o: In function `Test::~Test()':
  7. main.cpp:(.text._ZN4TestD1Ev[Test::~Test()]+0x14): undefined reference to `vtable for Test'
  8. collect2: ld returned 1 exit status
  9. make: *** [test] Error 1
To copy to clipboard, switch view to plain text mode 

How can this be fixed?