Qt错误 error: collect2: ld returned 1 exit status求解答,以贴源代码
#include<QThread>#include<QCoreApplication>#include<iostream>using namespace std;class MyThread : public QThread { Q_OBJECT public: MyThread(); ~MyThread(); protected: void run() { cout << "I run the thread" <<endl; } };MyThread::MyThread(){}MyThread::~MyThread(){}int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); MyThread myThread; myThread.start(); return a.exec(); }