OS: Ubuntu Linux 8.10 x64
QT version: 4.4.3
The code:
Code:
#include <QApplication> #include <QHttp> #include <QString> #include <iostream> { Q_OBJECT QHttp objQHttp; public: { connect(&objQHttp, SIGNAL(dataReadProgress(int, int)), this, SLOT(DisplayProgress(int, int))); objQHttp.get("/linux/ubuntu-releases/intrepid/ubuntu-8.10-desktop-amd64.iso"); } private slots: void DisplayProgress(int done, int total) { std::cout<< done<< " of "<< total<< " has been downloaded so far\n"; } }; int main(int argc, char *argv[]) { Test obj(0); app.exec(); return 0; }
with QT+= network added in the .pro file, produces:
Code:
john@ubuntu:~/Projects/qt/test$ make g++ -Wl,--no-undefined -o test main.o -L/usr/lib -lQtGui -lQtNetwork -lQtCore -lpthread main.o: In function `main': main.cpp:(.text+0x77): undefined reference to `vtable for Test' main.cpp:(.text+0x117): undefined reference to `vtable for Test' main.o: In function `Test::~Test()': main.cpp:(.text._ZN4TestD1Ev[Test::~Test()]+0x14): undefined reference to `vtable for Test' collect2: ld returned 1 exit status make: *** [test] Error 1
How can this be fixed?