我按照PDF来做,最后make,显示下面的内容:
[root@iFico hello]# make
Makefile:127: warning: overriding commands for target `moc_hello.cpp'
Makefile:124: warning: ignoring old commands for target `moc_hello.cpp'
g++ -c -pipe -Wall -W -O2 -o hello.o hello.cpp
In file included from hello.cpp:10:
hello.h:13:22: qvariant.h: 没有那个文件和目录
hello.h:14:21: qwidget.h: 没有那个文件和目录
In file included from hello.cpp:10:
hello.h:23: parse error before `{' token
hello.h:28: destructors must be member functions
hello.h:34: parse error before `public'
hello.cpp:12:22: qvariant.h: 没有那个文件和目录
hello.cpp:13:20: qlabel.h: 没有那个文件和目录
hello.cpp:14:25: qpushbutton.h: 没有那个文件和目录
hello.cpp:15:21: qlayout.h:没有那个文件和目录
hello.cpp:16:22: qtooltip.h: 没有那个文件和目录
hello.cpp:17:24: qwhatsthis.h: 没有那个文件和目录
hello.cpp:23: `QWidget' was not declared in this scope
hello.cpp:23: `parent' was not declared in this scope
hello.cpp:23: parse error before `char'
hello.cpp:24: invalid use of undefined type `class hello'
hello.h:22: forward declaration of `class hello'
hello.cpp: In constructor `hello::hello(...)':
hello.cpp:24: `parent' undeclared (first use this function)
hello.cpp:24: (Each undeclared identifier is reported only once for each
function it appears in.)
hello.cpp:24: `name' undeclared (first use this function)
hello.cpp:24: `fl' undeclared (first use this function)
hello.cpp:24: class `hello' does not have any field named `QWidget'
hello.cpp:27: `setName' undeclared (first use this function)
hello.cpp:29: invalid use of undefined type `struct QLabel'
hello.h:19: forward declaration of `struct QLabel'
hello.cpp:30: `QRect' undeclared (first use this function)
hello.cpp:31: `QFont' undeclared (first use this function)
hello.cpp:31: parse error before `(' token
hello.cpp:32: `user_t_font' undeclared (first use this function)
hello.cpp:32: `TRUE' undeclared (first use this function)
hello.cpp:35: invalid use of undefined type `struct QPushButton'
hello.h:20: forward declaration of `struct QPushButton'
hello.cpp:38: invalid use of undefined type `struct QPushButton'
hello.h:20: forward declaration of `struct QPushButton'
hello.cpp:40: `languageChange' undeclared (first use this function)
hello.cpp:41: `QSize' undeclared (first use this function)
hello.cpp:41: `minimumSizeHint' undeclared (first use this function)
hello.cpp:41: `resize' undeclared (first use this function)
hello.cpp:44: `clicked' undeclared (first use this function)
hello.cpp:44: `SIGNAL' undeclared (first use this function)
hello.cpp:44: `user_button' undeclared (first use this function)
hello.cpp:44: `SLOT' undeclared (first use this function)
hello.cpp:44: `connect' undeclared (first use this function)
hello.cpp:45: `close' cannot be used as a function
hello.cpp: At global scope:
hello.cpp:52: invalid use of undefined type `class hello'
hello.h:22: forward declaration of `class hello'
hello.cpp:61: invalid use of undefined type `class hello'
hello.h:22: forward declaration of `class hello'
hello.cpp: In member function `void hello::languageChange()':
hello.cpp:62: `tr' undeclared (first use this function)
hello.cpp:62: `setCaption' undeclared (first use this function)
hello.cpp:63: `QString' undeclared (first use this function)
hello.cpp:63: parse error before `::' token
hello.cpp: At global scope:
hello.cpp:69: invalid use of undefined type `class hello'
hello.h:22: forward declaration of `class hello'
make: *** [hello.o] Error 1