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。

相关推荐
宏笋9 小时前
Qt开发了一款绘图和制作信笺的软件
qt
半杯咖啡半行码13 小时前
Qt 隐式共享(Implicit Sharing)深度解析:机制、陷阱与 Qt6迁移
开发语言·数据库·qt
慧都产品智能化1 天前
Qt 开发 CAD/CAM 工序表的隐性成本分析
c++·qt·qt5·qt6.3
ShineWinsu2 天前
对于Qt窗口:QMainWindow、QMenuBar、Qmenu、QAction的解析
c++·qt·菜单·qmainwindow·qaction·qmenu·qmenubar
ShineWinsu2 天前
对于Qt:QSpacerItem常见属性以及方法的解析
开发语言·c++·qt·面试·系统架构·客户端·qspaceritem
ShineWinsu2 天前
对于Qt:QGripLayout常见属性、方法以及QSizePolicy的解析
开发语言·c++·qt·面试·gui·客户端·网格
艾莉丝努力练剑3 天前
【QT】系统相关:TCP的API介绍
开发语言·前端·c++·人工智能·qt·学习·tcp/ip
ShineWinsu3 天前
对于Qt:QVBoxLayout常见属性以及方法的解析
开发语言·数据库·c++·qt·gui·客户端·布局管理器
ShineWinsu3 天前
对于Qt:QFormLayout常见属性以及方法的解析
开发语言·c++·qt·面试·客户端·表单·qformlayout
ShineWinsu4 天前
对于Qt:QHBoxLayout常见属性以及方法的解析
c++·qt·面试·gui·客户端·布局管理器·水平布局器