0

I'm working with Qt5.4.1, and implementing a server-client application. In the QTcpServer class the method:

void incomingConnection(int socketDescriptor); 

has integer type for the socketDescriptor, but for Qt5.5, this method has changed and has the following declaration:

void incomingConnection (qintptr socketDescriptor);

The problem is that my compiler does not find the typedef qintptr. The error message is that qintptr has not been declared.

I have added the header file

#include <QtGlobal>

but the compiler still doesn't find this type.

When I change the qintptr to quintptr, the compiler finds it, but this type gives type mismatch error. How can I solve this problem?

IAmInPLS
  • 4,051
  • 4
  • 24
  • 57
Waleed A
  • 95
  • 10

1 Answers1

0

The problem is that the project was opened in qt5, but still has some references to the old version of qt (4.8.x). Therefore it was looking for qtptr in the path /usr/include/QtCore/qglobal.h. I have changed the path to /opt/Qt5.../QtCore/qglobal.h and the problem is solved

Waleed A
  • 95
  • 10
  • Where can I change this? – Alexandre Justino May 12 '16 at 18:41
  • @Alexander In QtCreator on the left bar you can find the Projects icon, click it, then under the Tab Build&Run you can find tow buttons Build, Run, above these buttons, you have the possibilty to change the kit to the version Qt5.x that support the qintptr type – Waleed A May 13 '16 at 08:10