I am using g ++ 4.6.0 to compile C ++ code that was successfully compiled in earlier versions.
if ( bind(iControl, (struct sockaddr *) &sa, sizeof(sa)) == -1) throw runtime_error ("bind");
where iControl is the socket and sa is the struct sockaddr_in .
However, in g ++ 4.6, I get the following error:
comms.cpp:93:66: error: no match for 'operator==' in 'std::bind(_Functor&&, _ArgTypes&& ...) [with _Functor = int&, _ArgTypes = {sockaddr*, long unsigned int}, typename std::_Bind_helper<_Functor, _ArgTypes>::type = std::_Bind<int(sockaddr*, long unsigned int)>]((* &((sockaddr*)(& sa))), (* &16ul)) == -0x00000000000000001'
comms.cpp: 93: 66: note: candidates:
and then about half of the possible candidates.
It seems to mix the binding function in sys/sockets.h with std :: bind in functional . How to fix these two issues without rewriting the entire source file to remove using namespace std ?
source share