C/C++ client server bind [closed]
Hi,
I've successfully added openCV to my project and i wanted to implement client-server system. The socket function doesn't throw an error but the bind method does
if(bind(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr))<0)
stating "invalid operands to binary expression "__bind<int &,sockaddr="" *,unsigned="" long="">' and 'int'".
I found the bind function is not the same.There seems to be another bind function when i added the openCV library which seems to be overlapping.Can someone please help me with this issue?
Thank you
my 1st guess: this is std::bind
so try either to use
::bind
or avoidusing namespace std;
yes ::bind worked.I don't understand why bind didn't work in the first place.Anyways thank you :)
if you use plain
bind
, it's unclear to your compiler if it should use the socket function, or the one from<functional>
. explicitly using::bind
resolves it.also please don't forget to close your github issue ;)