本人Qt的版本4.4.0.是Open SUSE 11.0 DVD i386集成自带的开发环境。 G++版本是4.3.1。
Q1: make中出现
../../include/QtGui/private/../../../src/gui/painting/qdrawhelper_p.h:1394: 错误:显式特例化不能有存储类型
../../include/QtGui/private/../../../src/gui/painting/qdrawhelper_p.h:1400: 错误:显式特例化不能有存储类型
../../include/QtGui/private/../../../src/gui/painting/qdrawhelper_p.h:1429: 错误:显式特例化不能有存储类型
../../include/QtGui/private/../../../src/gui/painting/qdrawhelper_p.h:1436: 错误:显式特例化不能有存储类型
这个原因是因为G++编译器的问题,版本太高。可以根据错误提示手动修改源代码把 static 去掉。
解下来编译中qdrawhelper.cpp可能也会出现如上情况,解决方案依旧。
Q2:make出现
../../include/QtGui/private/../../../src/gui/kernel/qapplication_p.h:347: error: multiple parameters named 'screen'
更改qapplication_p.h并找到相应的位置,将源代码的screen改为screen_t
#vi src/gui/kernel/qapplication_p.h
#void setScreenTransformation(QScreen *screen, int screen_t, int transformation);