receiving_func(void* v)
takes 1 argument, but std::thread(&TcpClient::receiving_func);
requires a function that takes zero arguments. What do you believe v
will be in the function?
You could perhaps std::thread(&TcpClient::receiving_func, NULL);
to compile (and set v == NULL
), or since you're not using v
, just remove it from the method signature.
Additionally, since receiving_func
is an object method (it's not static), this is a problem, since there's no way to identify the this
value. You probably want to make the function static, make its parameter a TcpClient *
, and create the thread with std::thread(&TcpClient::receiving_func, this);
, and finally, use the parameter to access the object members instead of this
(as there is no this
on a static method).