在Windows XP下编译Qt4的问题

在Windows XP下编译Qt4,运行configure.exe一切正常,mingw32-make后,出现如下严重错误:

styles/qwindowsxpstyle.cpp:3677: warning: unused variable 'dwOpt'
mingw32-make[2]: *** [tmp/obj/debug_shared/qwindowsxpstyle.o] Error 1
mingw32-make[2]: Leaving directory `C:/Qt/4.0.0src/gui'
mingw32-make[1]: *** [debug] Error 2
mingw32-make[1]: Leaving directory `C:/Qt/4.0.0/src/gui'
mingw32-make: *** [debug-gui] Error 2

在网上google到了一些资料,说是系统中找不到windowsxp的窗体式样的sdk,然后安装了Microsoft Windows SDK,并加入到系统变量中,还是没有解决问题。

然后尝试着通过编辑styles.pri注释掉windowsxp style:

#contains( styles, windowsxp ) {
#    HEADERS += styles/qwindowsxpstyle.h
#    SOURCES += styles/qwindowsxpstyle.cpp
#    !contains( styles, windows ) {
#        message( windowsxp requires windows )
#        styles += windows
#        DEFINES+= QT_STYLE_WINDOWS
#    }
#} else {
   DEFINES += QT_NO_STYLE_WINDOWSXP
#}

虽然这次重新编译后,原有的问题确实解决了,然后又出现了新的问题,导致make没能成功。

最后,参考了configure.exe -help得出的解决途径,相当简单,使用configure.exe时增加-no-style-windowsxp即可。即:configure.exe -no-style-windowsxp,然后make成功。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值