Boost logo

Boost Users :

Subject: Re: [Boost-users] Conflict between boost::bind and winsock's bind function
From: Igor R (boost.lists_at_[hidden])
Date: 2012-07-24 11:07:30


> I’m using winsock’s bind function in my code.
>
> After adding a bunch of header files related to boost for some other added
> functionality, I’m getting this error:
>
> error C2668: 'boost::bind' : ambiguous call to overloaded function
>
> 1> c:\boost_1_49_0\boost\bind\bind.hpp(1480): could be
> 'boost::_bi::bind_t<R,F,L> boost::bind<SOCKET,sockaddr*,unsigned
> int>(F,A1,A2)'
>
> 1> with
>
> 1> [
>
> 1> R=boost::_bi::unspecified,
>
> 1> F=SOCKET,
>
> 1> L=boost::_bi::list2<boost::_bi::value<sockaddr
> *>,boost::_bi::value<unsigned int>>,
>
> 1> A1=sockaddr *,
>
> 1> A2=unsigned int
>
> 1> ]

Perhaps, you imported the whole boost namespace into the global scope?
Usually it's not a good idea.

> How do I specify that I want to use winsock’s bind function and not boost’s?

Try ::bind(.....)


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net