collect: ld returned 1 exit status
问题:如果有自定义的类,类中定义了构造函数,和析构函数时,请注意析构函数声明了,记得定义,如果不想麻烦,在定义时可以:
1 #ifndef MYCONFIG_H
2 #define MYCONFIG_H
3
4
5 #include <QtGui/QWidget>
6 #include <QLabel>
7 #include <QLineEdit>
8
9
10 class MyPage1 : public QWidget
11 {
12 Q_OBJECT
13
14 public:
15 MyPage1(QWidget *parent = 0);
16 ~MyPage1(){};
17 QLabel *NameLabel,*HeightLabel,*NumLabel,*QuotationLabel;
18 QLineEdit *NameEdit,*HeightEdit,*NumEdit,*QuotationEdit;
19 };
20
21 class MyPage2 : public QWidget
22 {
23 Q_OBJECT
24
25 public:
26 MyPage2(QWidget *parent = 0);
27 ~MyPage2(){};
28
29 };
30 class MyPage3 : public QWidget
31 {
32 Q_OBJECT
33
34 public:
35 MyPage3(QWidget *parent = 0);
36 ~MyPage3(){};
37
38 };
39 #endif // MYCONFIG_H