• 12169阅读
  • 6回复

【提问】qt3程序在qt4.0.1下怎么也编译通不过!!! [复制链接]

上一主题 下一主题
离线adonislsw
 
只看楼主 倒序阅读 楼主  发表于: 2005-08-29
qt3的一个程序,在qt3.3.3下没有一点问题,但是按照qt4的说明怎么也通不过!!!即使用qt3to4也不行。郁闷啊!!!
[ 此贴被XChinux在2005-08-29 21:32重新编辑 ]
附件: oventimer.rar (3 K) 下载次数:12
为了生活四处漂泊
离线adonislsw
只看该作者 1楼 发表于: 2005-08-29
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(QPainter*)':
oventimer.cpp:82: error: `QPointArray' undeclared (first use this function)
oventimer.cpp:100: error: `AlignHCenter' undeclared (first use this function)
oventimer.cpp:100: error: `AlignTop' undeclared (first use this function)
make: *** [oventimer.o] ## 1
为了生活四处漂泊
离线adonislsw
只看该作者 2楼 发表于: 2005-08-29
$ qt3to4 oventimer.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/include/QtGui/qpainter.h:69: error:          
  QPainter::QPainter()
oventimer.cpp: In member function `void OvenTimer::draw(QPainter*)':
oventimer.cpp:82: error: `QPointArray' undeclared (first use this function)
oventimer.cpp:100: error: `AlignHCenter' undeclared (first use this function)
oventimer.cpp:100: error: `AlignTop' undeclared (first use this function)
make: *** [oventimer.o] ## 1
为了生活四处漂泊
离线adonislsw
只看该作者 3楼 发表于: 2005-08-30
没有人关心吗?大家都不编译qt3程序?
为了生活四处漂泊
离线XChinux

只看该作者 4楼 发表于: 2005-08-30
俺没有程序要升级。所以只要用新的就行了。
二笔 openSUSE Vim N9 BB10 XChinux@163.com 网易博客 腾讯微博
承接C++/Qt、Qt UI界面、PHP及预算报销系统开发业务
离线tdns

只看该作者 5楼 发表于: 2005-08-31
Qt升级到版本4以后改动了很多地方.比如头文件的引用方式,库的结构,Designer等等.有些类被取消了,比如你程序里用的QPointArray,现在可以用QVector<QPoint>代替,还有一些类的接口也改动了很多,比如QString. 所以最好的办法就是修改你的代码. 另外Qt3Support的相关类不推荐用,那些东西迟早要被淘汰的.
离线adonislsw
只看该作者 6楼 发表于: 2005-08-31
qt的版本升级是好事,可是个人认为不应以破坏兼容性为代价!如果修改代码,对于比较大的工程是不可能的,浪费人力物力啊。不知道奇趣公司怎么考虑的。
为了生活四处漂泊
快速回复
限100 字节
 
上一个 下一个