|
Boost Users : |
From: HeavyWave (hw_at_[hidden])
Date: 2007-04-10 12:05:28
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::map<std::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::map<std::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_at_function@detail_at_boost@@YA?ATany_pointer_at_123@PAX_at_Z) already defined in Main.obj
1>IParser.obj : error LNK2005: "bool __cdecl boost::detail::function::has_empty_target(...)" (?has_empty_target_at_function@detail_at_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
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