Boost logo

Boost Users :

Subject: Re: [Boost-users] [bind?] 'boost::bind' : ambiguous call to overloaded function -- when compiling for x64
From: Igor R (boost.lists_at_[hidden])
Date: 2012-03-08 16:25:59


> My project builds well with MSVC10 for x86 platform. However, when I
> tried to build it for x64, I started to get the following strange
> error:
>
> 1>...cpp(42): error C2668: 'boost::bind' : ambiguous call to overloaded function
> 1>          ...\boost\boost/bind/bind_mf_cc.hpp(43): could be
> 'boost::_bi::bind_t<R,F,L> boost::bind<void,MyImpl,const
> boost::system::error_code&,boost::shared_ptr<T>,boost::system::error_code>(R
> (__cdecl MyImpl::* )(B1),A1,A2)'
> <...>
> 1>          ...\boost\boost/bind/bind_mf_cc.hpp(43): or
> 'boost::_bi::bind_t<R,F,L> boost::bind<void MyImpl,const
> boost::system::error_code&,boost::shared_ptr<T>,boost::system::error_code>(R
> (__cdecl MyImpl::* )(B1),A1,A2)'
>
> Note that the both variants are actually the same one.

Well, as usually, the problem was solved two minutes after the
question had been sent.
The problem was that my precompiled header contained the following definition:

#ifdef _WIN32
  #define BOOST_MEM_FN_ENABLE_STDCALL
#endif

and it appears that _WIN32 is defined both for x86 and for x64 platforms...


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