首页| 论坛| 消息

标题:【提问】qt3程序在qt4.0.1下怎么也编译通不过!!!
作者:adonislsw
日期:2005-08-29 20:38
内容:

qt3的一个程序,在qt3.3.3下没有一点问题,但是按照qt4的说明怎么也通不过!!!即使用qt3to4也不行。郁闷啊!!!


#1 [adonislsw 08-29 20:41]
make
g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_CORE_LIB -DQT_GUI_LIB -DQT_QT3SUPPORT
_LIB -DQT3_SUPPORT -DQT_SHARED -I/usr/local/Trolltech/Qt-4.0.1/mkspecs/linux-g++
-I. -I/usr/local/Trolltech/Qt-4.0.1/include/Qt3Support -I/usr/local/Trolltech/Q
t-4.0.1/include/QtGui -I/usr/local/Trolltech/Qt-4.0.1/include/QtCore -I/usr/loca
l/Trolltech/Qt-4.0.1/include -I. -I. -I. -o main.o main.cpp
g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_CORE_LIB -DQT_GUI_LIB -DQT_QT3SUPPORT
_LIB -DQT3_SUPPORT -DQT_SHARED -I/usr/local/Trolltech/Qt-4.0.1/mkspecs/linux-g++
-I. -I/usr/local/Trolltech/Qt-4.0.1/include/Qt3Support -I/usr/local/Trolltech/Q
t-4.0.1/include/QtGui -I/usr/local/Trolltech/Qt-4.0.1/include/QtCore -I/usr/loca
l/Trolltech/Qt-4.0.1/include -I. -I. -I. -o oventimer.o oventimer.cpp
oventimer.cpp: In constructor `OvenTimer::OvenTimer(QWidget*, const char*)':
oventimer.cpp:17: error: `WNoAutoErase' undeclared (first use this function)
oventimer.cpp:17: error: (Each undeclared identifier is reported only once for
each function it appears in.)
oventimer.cpp: In member function `virtual void
OvenTimer::mousePressEvent(QMouseEvent*)':
oventimer.cpp:46: error: `pos' undeclared (first use this function)
oventimer.cpp: In member function `virtual void
OvenTimer::paintEvent(QPaintEvent*)':
oventimer.cpp:56: error: `rect' undeclared (first use this function)
oventimer.cpp:62: error: no matching function for call to `QPainter::QPainter(
QPixmap*, OvenTimer* const)'
/usr/local/Trolltech/Qt-4.0.1/include/QtGui/qpainter.h:57: error: candidates
are: QPainter::QPainter(const QPainter&)
/usr/local/Trolltech/Qt-4.0.1/include/QtGui/qpainter.h:70: error:
QPainter::QPainter(QPaintDevice*)
/usr/local/Trolltech/Qt-4.0.1/include/QtGui/qpainter.h:69: error:
QPainter::QPainter()
oventimer.cpp: In member function `void OvenTimer::draw ..
#2 [adonislsw 08-29 20:42]
$ qt3to4oventimer.pro
Using rules file: /usr/local/Trolltech/Qt-4.0.1/q3porting.xml
Parsing..
Convert file /home/liusw/oventime/oventimer.cpp? (Y)es, (N)o, (A)ll a
Could not write to to file: /home/liusw/oventime/oventimer.cpp. Is it write protected?
Could not write to to file: /home/liusw/oventime/oventimer.h. Is it write protected?
Wrote to file: /home/liusw/oventime/oventimer.pro
Writing log to portinglog.txt
Overwrite file portinglog.txt? (Y)es, (N)o, (A)ll a

$ make
/usr/local/Trolltech/Qt-4.0.1/bin/qmake -unix -o Makefile oventimer.pro
g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_CORE_LIB -DQT_GUI_LIB -DQT_QT3SUPPORT_LIB -DQT3_SUPPORT -DQT_SHARED -I/usr/local/Trolltech/Qt-4.0.1/mkspecs/linux-g++ -I. -I/usr/local/Trolltech/Qt-4.0.1/include/Qt3Support -I/usr/local/Trolltech/Qt-4.0.1/include/QtGui -I/usr/local/Trolltech/Qt-4.0.1/include/QtCore -I/usr/local/Trolltech/Qt-4.0.1/include -I. -I. -I. -o oventimer.o oventimer.cpp
oventimer.cpp: In constructor `OvenTimer::OvenTimer(QWidget*, const char*)':
oventimer.cpp:17: error: `WNoAutoErase' undeclared (first use this function)
oventimer.cpp:17: error: (Each undeclared identifier is reported only once for
each function it appears in.)
oventimer.cpp: In member function `virtual void
OvenTimer::mousePressEvent(QMouseEvent*)':
oventimer.cpp:46: error: `pos' undeclared (first use this function)
oventimer.cpp: In member function `virtual void
OvenTimer::paintEvent(QPaintEvent*)':
oventimer.cpp:56: error: `rect' undeclared (first use this function)
oventimer.cpp:62: error: no matching function for call to `QPainter::QPainter(
QPixmap*, OvenTimer* const)'
/usr/local/Trolltech/Qt-4.0.1/include/QtGui/qpainter.h:57: error: candidates
are: QPainter::QPainter(const QPainter&)
/usr/local/Trolltech/Qt-4.0.1/include/QtGui/qpainter.h:70: error:
QPainter::QPainter(QPaintDevice*)
/usr/local/Trolltech/Qt-4.0.1/in ..
#3 [adonislsw 08-30 15:08]
没有人关心吗?大家都不编译qt3程序?
#4 [XChinux 08-30 15:34]
俺没有程序要升级。所以只要用新的就行了。
#5 [tdns 08-31 15:00]
Qt升级到版本4以后改动了很多地方.比如头文件的引用方式,库的结构,Designer等等.有些类被取消了,比如你程序里用的QPointArray,现在可以用QVector代替,还有一些类的接口也改动了很多,比如QString. 所以最好的办法就是修改你的代码. 另外Qt3Support的相关类不推荐用,那些东西迟早要被淘汰的.

<< 1 2 >> (1/2)

回复 发表
主题 版块