有问题的代码:
boost::function<bool()> isSpecialWeapon = boost::bind(&WeaponBase::GetType,this) == WeaponType::SPECIAL_WEAPON;
我得到的错误是这样的:
undefined reference to `boost::_bi::bind_t<bool, boost::_bi::equal,
boost::_bi::list2<boost::_bi::bind_t<WeaponType::Guns,
boost::_mfi::cmf0<WeaponType::Guns, WeaponBase>,
boost::_bi::list1<boost::_bi::value<WeaponBase*> > >,
boost::_bi::add_value<WeaponType::Guns>::type> > boost::_bi::operator==
<WeaponType::Guns, boost::_mfi::cmf0<WeaponType::Guns, WeaponBase>,
boost::_bi::list1<boost::_bi::value<WeaponBase*> >, WeaponType::Guns>
(boost::_bi::bind_t<WeaponType::Guns, boost::_mfi::cmf0<WeaponType::Guns, WeaponBase>,
boost::_bi::list1<boost::_bi::value<WeaponBase*> > > const&, WeaponType::Guns)'