编译qt可以在windows下面运行,但是在linux下编译为什么提示这样的错误呢? 10
[root@localhostclock]#makemake:Warning:File`clock.cpp'hasmodificationtime2.4e+06sinth...
[root@localhost clock]# make
make: Warning: File `clock.cpp' has modification time 2.4e+06 s in the future
g++ -c -pipe -Wall -W -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -DQT_NO_DEBUG -DQT_SHARED -DQT_THREAD_SUPPORT -I/usr/lib/qt-3.3/mkspecs/default -I. -I. -I/usr/lib/qt-3.3//include -o clock.o clock.cpp
In file included from clock.cpp:1:
clock.h:4:14: error: QT: No such file or directory
clock.h:5:27: error: QtGui/QWidget: No such file or directory
clock.cpp:3:17: error: QTime: No such file or directory
clock.h:11: error: invalid use of undefined type 钬荣truct QWidget钬
/usr/lib/qt-3.3//include/qwindowdefs.h:52: error: forward declaration of 钬荣truct QWidget钬
clock.h:12: error: 钬楺Variant钬has not been declared
clock.h:12: error: 钬楺Variant钬has not been declared
clock.h:18: error: 钬楺PaintEvent钬has not been declared
clock.h:11: warning: 钬榗lass clock钬has virtual functions but non-virtual destructor
clock.cpp: In constructor 钬榗lock::clock(QWidget*)钬
clock.cpp:5: error: type 钬楺Widget钬is not a direct base of 钬榗lock钬
clock.cpp:7: error: no matching function for call to 钬楺Timer::QTimer(clock* const)钬
/usr/lib/qt-3.3//include/qtimer.h:76: note: candidates are: QTimer::QTimer(const QTimer&)
/usr/lib/qt-3.3//include/qtimer.h:50: note: QTimer::QTimer(QObject*, const char*)
clock.cpp:9: error: 钬榬esize钬was not declared in this scope
clock.cpp:10: error: 钬榗onnect钬was not declared in this scope
clock.cpp: At global scope:
clock.cpp:17: error: prototype for 钬榲oid clock::paintEvent(QPaintEvent*)钬does not match any in class 钬榗lock钬
clock.h:18: error: candidate is: void clock::paintEvent(int*)
clock.cpp: In member function 钬榲oid clock::paintEvent(QPaintEvent*)钬
clock.cpp:20: error: no matching function for call to 钬楺Painter::QPainter(clock* const)钬
/usr/lib/qt-3.3//include/qpainter.h:428: note: candidates are: QPainter::QPainter(const QPainter&)
/usr/lib/qt-3.3//include/qpainter.h:74: note: QPainter::QPainter(const QPaintDevice*, const QWidget*, bool)
/usr/lib/qt-3.3//include/qpainter.h:73: note: QPainter::QPainter(const QPaintDevice*, bool)
/usr/lib/qt-3.3//include/qpainter.h:72: note: QPainter::QPainter()
clock.cpp:21: error: variable 钬楺Time time钬has initializer but incomplete type
clock.cpp:21: error: incomplete type 钬楺Time钬used in nested name specifier
clock.cpp:28: error: 钬榗lass QPainter钬has no member named 钬荣etRenderHint钬
clock.cpp:28: error: 钬楢ntialiasing钬is not a member of 钬楺Painter钬
clock.cpp:31: error: invalid conversion from 钬楺Point*钬to 钬榠nt钬 展开
make: Warning: File `clock.cpp' has modification time 2.4e+06 s in the future
g++ -c -pipe -Wall -W -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -DQT_NO_DEBUG -DQT_SHARED -DQT_THREAD_SUPPORT -I/usr/lib/qt-3.3/mkspecs/default -I. -I. -I/usr/lib/qt-3.3//include -o clock.o clock.cpp
In file included from clock.cpp:1:
clock.h:4:14: error: QT: No such file or directory
clock.h:5:27: error: QtGui/QWidget: No such file or directory
clock.cpp:3:17: error: QTime: No such file or directory
clock.h:11: error: invalid use of undefined type 钬荣truct QWidget钬
/usr/lib/qt-3.3//include/qwindowdefs.h:52: error: forward declaration of 钬荣truct QWidget钬
clock.h:12: error: 钬楺Variant钬has not been declared
clock.h:12: error: 钬楺Variant钬has not been declared
clock.h:18: error: 钬楺PaintEvent钬has not been declared
clock.h:11: warning: 钬榗lass clock钬has virtual functions but non-virtual destructor
clock.cpp: In constructor 钬榗lock::clock(QWidget*)钬
clock.cpp:5: error: type 钬楺Widget钬is not a direct base of 钬榗lock钬
clock.cpp:7: error: no matching function for call to 钬楺Timer::QTimer(clock* const)钬
/usr/lib/qt-3.3//include/qtimer.h:76: note: candidates are: QTimer::QTimer(const QTimer&)
/usr/lib/qt-3.3//include/qtimer.h:50: note: QTimer::QTimer(QObject*, const char*)
clock.cpp:9: error: 钬榬esize钬was not declared in this scope
clock.cpp:10: error: 钬榗onnect钬was not declared in this scope
clock.cpp: At global scope:
clock.cpp:17: error: prototype for 钬榲oid clock::paintEvent(QPaintEvent*)钬does not match any in class 钬榗lock钬
clock.h:18: error: candidate is: void clock::paintEvent(int*)
clock.cpp: In member function 钬榲oid clock::paintEvent(QPaintEvent*)钬
clock.cpp:20: error: no matching function for call to 钬楺Painter::QPainter(clock* const)钬
/usr/lib/qt-3.3//include/qpainter.h:428: note: candidates are: QPainter::QPainter(const QPainter&)
/usr/lib/qt-3.3//include/qpainter.h:74: note: QPainter::QPainter(const QPaintDevice*, const QWidget*, bool)
/usr/lib/qt-3.3//include/qpainter.h:73: note: QPainter::QPainter(const QPaintDevice*, bool)
/usr/lib/qt-3.3//include/qpainter.h:72: note: QPainter::QPainter()
clock.cpp:21: error: variable 钬楺Time time钬has initializer but incomplete type
clock.cpp:21: error: incomplete type 钬楺Time钬used in nested name specifier
clock.cpp:28: error: 钬榗lass QPainter钬has no member named 钬荣etRenderHint钬
clock.cpp:28: error: 钬楢ntialiasing钬is not a member of 钬楺Painter钬
clock.cpp:31: error: invalid conversion from 钬楺Point*钬to 钬榠nt钬 展开
展开全部
还是使用QT SDK吧,编译出错看得一清二楚。关于QT的跨平台,国内很少有人去关注,其实实现源码项目的跨平台的关键就是一个文件:平台配置文件,一个你在编写代码时不会亲自去写的文件,QT SDK自动生成的文件,不同平台、相同程序会生成不同的配置文件,而那个配置文件就决定了程序编译时的环境。所以删除那个文件即可编译成功。究竟那个文件是谁?自己观察观察就OK了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
你这怎么直接make?
首先确保你的qt装好了,最好通过源直接安装。比如: sudo apt-get install qt4.7
然后 编译一般先:
qmake -project
qmake
make
首先确保你的qt装好了,最好通过源直接安装。比如: sudo apt-get install qt4.7
然后 编译一般先:
qmake -project
qmake
make
追问
我已经安装了 可以qq谈吗?277247186或者留下你的qq号码
追答
Quner612@qq.com, 这个就可以加我了。
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
添加环境变量了吗?我怎么看见QT3.3,难道你装的是3.3版的?
追问
嗯 是啊 怎么添加环境变量啊?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |