Question

I have this included:

#include <sys/socket.h> /* for socket(), connect(), send(), and recv() */

/* Establish the connection to the echo server */
if (connect(sock, (struct sockaddr *) &echoServAddr, sizeof(echoServAddr)) < 0)
    DieWithError("connect() failed");

But I am getting this:

TCPClient.cpp:395: error: no matching function for call to ‘ClientHandler::connect(int&, sockaddr*, unsigned int)’

The thing is I am also using QT.

should I have somethihng before "connect"... SOMETHING::connect(....)

Thanks :)

Was it helpful?

Solution

I guess you have your own class ClientHandler with a connect method. To avoid confusion call connect from the global namespace:

::connect ( sock, ...
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top