本帖最后由 孤独寒烟 于 2011-11-17 00:08 编辑
大家好,依照Qt开发完全手册编译手册第三章的那个Qt的程序时,出现那面的问题,自己完全是按手册源码写的,为什么编译不过,请高手帮忙解答一下。对了,原程序中user_b换成my_dream,user_t换成了my_work.
g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -DNO_DEBUG -I/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qt2/include -I/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qtopia/include -o first.o first.cpp
In file included from first.cpp:9:
first.h:33: declaration of `virtual void first::my_dream()'
first.h:30: conflicts with previous declaration `QPushButton*first::my_dream'
first.cpp: In constructor `first::first(QWidget*, const char*, unsigned int)':
first.cpp:32: invalid use of member (did you forget the `&' ?)
first.cpp:33: invalid use of member (did you forget the `&' ?)
first.cpp:33: base operand of `->' is not a pointer
first.cpp:34: invalid use of member (did you forget the `&' ?)
first.cpp:34: base operand of `->' is not a pointer
first.cpp:44: `PixmapLabell' undeclared (first use this function)
first.cpp:44: (Each undeclared identifier is reported only once for each
function it appears in.)
first.cpp:46: `image0' undeclared (first use this function)
first.cpp:55: no matching function for call to `first::connect(<unknown type>,
const char[11], first* const, const char[12])'
/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qt2/include/qobject.h:110: candidates are:
static bool QObject::connect(const QObject*, const char*, const QObject*,
const char*)
/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qt2/include/qobject.h:210:
bool QObject::connect(const QObject*, const char*, const char*) const
first.cpp: In member function `virtual void first::my_dream()':
first.cpp:85: `class QLabel' has no member named `set'
first.cpp:85: parse error before `(' token
make: *** [first.o] Error 1 |