I can't figure out why I'm getting this error yet the same class worked perfectly under VS15 now I'm using VS12, it's a simple Winsock2 implementation,
int Net::createServer(int port, int protocol)
{
int status;
// ----- Initialize network stuff -----
status = initialize(port, protocol);
if (status != NET_OK)
return status;
localAddr.sin_addr.s_addr = htonl(INADDR_ANY); // listen on all addresses
// bind socket
if (bind(sock, (SOCKADDR *)&localAddr, sizeof(localAddr)) == SOCKET_ERROR)
{
status = WSAGetLastError(); // get detailed error
return ((status << 16) + NET_BIND_FAILED);
}
bound = true;
mode = SERVER;
return NET_OK;
}
the problem comes from here
if (bind(sock, (SOCKADDR *)&localAddr, sizeof(localAddr)) == SOCKET_ERROR)
Console Logs :
error C2678: binary '==' : no operator found which takes a left-hand operand of type 'std::_Bind<_Forced,_Ret,_Fun,_V0_t,_V1_t,_V2_t,_V3_t,_V4_t,_V5_t,<unnamed-symbol>>' (or there is no acceptable conversion)
1> with
1> [
1> _Forced=false,
1> _Ret=void,
1> _Fun=SOCKET &,
1> _V0_t=SOCKADDR *,
1> _V1_t=size_t,
1> _V2_t=std::_Nil,
1> _V3_t=std::_Nil,
1> _V4_t=std::_Nil,
1> _V5_t=std::_Nil,
1> <unnamed-symbol>=std::_Nil
1> ]