首页| 论坛| 消息

标题:【提问】我是新手,刚刚装完qt-4.1.1,但试图编译一个demo时报错,请帮忙!
作者:712100
日期:2006-03-05 01:06
内容:

我是新手,刚刚装完qt-4.1.1,但试图编译一个demo时报错,请帮忙!
jun@linux:/usr/local/Trolltech/Qt-4.1.1/demos/deform> qmake -project
jun@linux:/usr/local/Trolltech/Qt-4.1.1/demos/deform> qmake
jun@linux:/usr/local/Trolltech/Qt-4.1.1/demos/deform> make all
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I../../mkspecs/linux-g++ -I. -I../../include/QtCore -I../../include/QtGui -I../../include -I. -I. -I. -o main.o main.cpp
In file included from main.cpp:24:
pathdeform.h:27:27: error: arthurwidgets.h: 没有那个文件或目录
pathdeform.h:34: error: expected class-name before ‘{’ token
pathdeform.h:47: error: ‘QMouseEvent’ has not been declared
pathdeform.h:48: error: ‘QMouseEvent’ has not been declared
pathdeform.h:49: error: ‘QMouseEvent’ has not been declared
pathdeform.h:50: error: ‘QTimerEvent’ has not been declared
pathdeform.h:85: error: field ‘m_lens_pixmap’ has incomplete type
pathdeform.h:86: error: field ‘m_lens_image’ has incomplete type
pathdeform.h:34: warning: ‘class PathDeformRenderer’ has virtual functions but non-virtual destructor
pathdeform.h: In member function ‘int PathDeformRenderer::radius() const’:
pathdeform.h:55: warning: converting to ‘int’ from ‘const double’
pathdeform.h: In member function ‘int PathDeformRenderer::intensity() const’:
pathdeform.h:57: warning: converting to ‘int’ from ‘const double’
pathdeform.h: At global scope:
pathdeform.h:98: error: invalid use of undefined type ‘struct QWidget’
../../include/QtGui/qwindowdefs.h:35: error: forward declaration of ‘struct QWidget’
main.cpp: In function ‘int main(int, char**)’:
main.cpp:35: error: expected type-specifier before ‘ArthurStyle’
main.cpp:35: error: cannot convert ‘int*’ to ‘QStyle*’ in initialization
main.cpp:35: error: expected ‘,’ or ‘;’ before ‘ArthurStyle’
main.cpp:36: error: ‘class PathDeformWidget’ has no member named ‘setStyle’
main.cpp:38: error: cannot convert ‘PathDeformWi ..


#1 [XChinux 03-05 01:58]
你没有设置QTDIR环境变量以及把$(QTDIR)/bin目录加到PATH变量中吧?
另外,Demo中的东西不能这样编译吧?
工程.pro文件是人家已经有了的,你不能通过qmake -project来生成,在demo中那样生成的工程信息不全。
编译Demo中的东西,要做的只是
#qmake
#make
就行了。

回复 发表
主题 版块