yektaayduk
11th February 2011, 09:25
I'm developing a client server application using winsock2.h functions of windows.
But I have also some Gui's which are coded in QT 4.7 in the project.
This part of the code is casue a build error:
code :
// Connect to server
iResult= connect( ConnectSocket, (SOCKADDR*) &clientService, sizeof(clientService) );
if (iResult == SOCKET_ERROR)
{
printf( "Failed to connect.\n" );
WSACleanup();
}
build error:
1>.\client_thread.cpp(80) : error C2664: 'bool QObject::connect(const QObject *,const char *,const char *,Qt::ConnectionType) const' : cannot convert parameter 1 from 'SOCKET' to 'const QObject *'
1> Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
Compiler is assuming that the connect function is the function of QT (connect signal slot).
How can I solve this ?
But I have also some Gui's which are coded in QT 4.7 in the project.
This part of the code is casue a build error:
code :
// Connect to server
iResult= connect( ConnectSocket, (SOCKADDR*) &clientService, sizeof(clientService) );
if (iResult == SOCKET_ERROR)
{
printf( "Failed to connect.\n" );
WSACleanup();
}
build error:
1>.\client_thread.cpp(80) : error C2664: 'bool QObject::connect(const QObject *,const char *,const char *,Qt::ConnectionType) const' : cannot convert parameter 1 from 'SOCKET' to 'const QObject *'
1> Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
Compiler is assuming that the connect function is the function of QT (connect signal slot).
How can I solve this ?