我正在使用 Qt5.4.1,并实现一个服务器-客户端应用程序。在 QTcpServer 类中的方法:
void incomingConnection(int socketDescriptor);
具有整数类型socketDescriptor
,但对于 Qt5.5,此方法已更改并具有以下声明:
void incomingConnection (qintptr socketDescriptor);
问题是我的编译器找不到 typedef qintptr
。错误消息是 qintptr 尚未声明。
我已经添加了头文件
#include <QtGlobal>
但编译器仍然找不到这种类型。
当我将 更改为qintptr
时quintptr
,编译器会找到它,但是这种类型会给出类型不匹配错误。我怎么解决这个问题?