boost.function and boost:bind in MSVS2005
Hi there. I'm using boost.function and boost:bind to point to Member function this way: class ModuleRegister { public: ModuleRegister(void); ~ModuleRegister(void); typedef boost::function1< std::string, std::mapstd::string,std::string > HEFunc; void RegisterClassMember(std::string & name, const HEFunc & f); }; class News : public BaseModule { public: News(void); ~News(void); std::string show(std::mapstd::string,std::string bb); }; than in other class void IParser::PrepareModules() { ModuleRegister::HEFunc f; f = boost::bind(&News::show, &NewsObj, _1); MRegister.RegisterClassMember(std::string("News.show"),f); } and I get 1>IParser.obj : error LNK2005: "union boost::detail::function::any_pointer __cdecl boost::detail::function::make_any_pointer(void *)" (?make_any_pointer@function@detail@boost@@YA?ATany_pointer@123@PAX@Z) already defined in Main.obj 1>IParser.obj : error LNK2005: "bool __cdecl boost::detail::function::has_empty_target(...)" (?has_empty_target@function@detail@boost@@YA_NZZ) already defined in Main.obj IParser.h is actually included in Main.h and #include "boost/function.hpp" is in ModuleRegister.h which is included in IParser.h can't handle this problem
participants (1)
-
HeavyWave