tags:

views:

57

answers:

1

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 :)

+2  A: 

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

::connect ( sock, ...
catwalk
Ahh, so what does that"::" do anyways?I know i had to do it before to use couti had std::coutbut what does it really mean
NeverAgain
@Nero: All functions outside namespaces and classes (generally all c library functions) are in the global namespace, that is their full qualified names look like ::function_name. The "::" is not usually needed, except in cases where you have a local (not in global namespace) function with the same name.
catwalk