|
Threads-Devel : |
From: PRELOT Thomas (tprelot_at_[hidden])
Date: 2007-03-28 13:14:32
Hi everyone,
I'm a french student in the last year in advanced engineering study.
I have to realize a project, I need to use boost, but I have a really
strange error :
error LNK2019: symbole externe non résolu "void __cdecl
boost::throw_exception(class std::exception const &)"
(?throw_exception_at_boost@@YAXABVexception_at_std@@@Z )
référencé dans la fonction "public: void __thiscall
boost::function0<void,class std::allocator<void> >::operator()(void)const "
( ??R?$function0_at_XV?$allocator_at_X@std@@@boost@@QBEXXZ) MessageManager.obj
It happens on :
void
MessageManager::listen()
{
boost::function< void(void) > func;
func = boost::bind( &MessageManager::run, this );
thrd_listen = new boost::thread ( func ); // this line gives the error.
}
and :
void
MessageManager::run()
{
stop = false;
string message;
dispatcher = new DispatchedMessage(this, eventManager);
boost::function< void(void) > func;
bool status = SendMessage(new ApplicationNameMessage("HL2", 0));
if( !status )
stop = true;
while (!stop)
{
message = ReceiveMessage();
if( message.length() > 0 )
{
//Thread pour dispatcher
func = boost::bind( &DispatchedMessage::analyser, dispatcher,
message );
boost::scoped_ptr<boost::thread> thrd_dispatch (
newboost::thread ( func )); //
this line gives the error.
}
else
{
cout<<"Pb : Déconnexion client !"<<endl;
stop = true;
closesocket(csock);
WSACleanup();
}
}
}
I'm a beginer in using boost ant that code has been written by my friend who
works on the project with me.
Thanks for your help !