Qt5.13引入QtWebApp的模块后报错: error C2440: “reinterpret_cast”: 无法从“int”转换为“quintptr”

1、开发环境

Win10-64 + qt5.13 + msvc2015-64bit-release

2、报错

新建一个demo工程。
引入QtWebApp的httpserver、logging、templateengine三个模块后。
直接运行,,此时报错如下:

cpp 复制代码
E:\Qt5.13.1\install\5.13.1\msvc2015_64\include\QtCore/qhashfunctions.h(109): error C2440: "reinterpret_cast": 无法从"int"转换为"quintptr"
E:\Qt5.13.1\install\5.13.1\msvc2015_64\include\QtCore/qhashfunctions.h(109): note: 强制转换是有效的标准强制转换,可以隐式执行或通过使用 static_cast、C 样式强制转换或函数样式强制转换执行
	cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zi -MDd -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc /Fddebug\TestHttp.vc.pdb -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DWIN64 -DQT_DEPRECATED_WARNINGS -DSUPERVERBOSE -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I..\TestHttp -I. -I..\TestHttp\logging -I..\TestHttp\httpserver -I..\TestHttp\templateengine -IE:\Qt5.13.1\install\5.13.1\msvc2015_64\include -IE:\Qt5.13.1\install\5.13.1\msvc2015_64\include\QtWidgets -IE:\Qt5.13.1\install\5.13.1\msvc2015_64\include\QtGui -IE:\Qt5.13.1\install\5.13.1\msvc2015_64\include\QtANGLE -IE:\Qt5.13.1\install\5.13.1\msvc2015_64\include\QtNetwork -IE:\Qt5.13.1\install\5.13.1\msvc2015_64\include\QtCore -Idebug -I. -I/include -IE:\Qt5.13.1\install\5.13.1\msvc2015_64\mkspecs\win32-msvc -Fodebug\ @C:\Users\XingWei\AppData\Local\Temp\staticfilecontroller.obj.22048.4609.jom

3、解决

将httpglobal.h中26-28行直接注释即可。

此时,重新运行,ok。

相关推荐
cn_mengbei20 小时前
鸿蒙PC开发指南:从零配置Qt环境到实战部署完整流程
qt·华为·harmonyos
GREGGXU20 小时前
Could not load the Qt platform plugin “xcb“ in ““ even though it was found.
linux·qt
Summer_Uncle20 小时前
【QT学习】qt项目使用MySQL数据库
数据库·qt·学习
Henry Zhu12321 小时前
Qt样式系统详解(上)
qt
深蓝海拓21 小时前
PySide6从0开始学习的笔记(二十三)使用QRunnable在线程池中执行临时任务
笔记·python·qt·学习·pyqt
嘿嘿潶黑黑1 天前
关于QButtonGroup 在Qt5和Qt6之间的差异
开发语言·qt
hqwest1 天前
码上通QT实战09--监控页面01-区域划分
开发语言·qt·layout·qss·qt 布局
mingren_13141 天前
c++和qml交互
c++·qt·交互
cn_mengbei1 天前
鸿蒙PC原生应用开发避坑指南:Qt 6.6与Electron 28兼容性问题全解析
qt·electron·harmonyos
cn_mengbei1 天前
鸿蒙PC上Qt原生应用开发:从零搭建开发环境到部署实战,附HarmonyOS SDK配置与避坑指南(C++实现)
c++·qt·harmonyos