Problems with reading into buffer using boost::asio::async_read

Posted by Max on Stack Overflow See other posts from Stack Overflow or by Max
Published on 2010-05-06T19:20:18Z Indexed on 2010/05/06 21:38 UTC
Read the original article Hit count: 353

Filed under:
|
|
|
|

Good day.

I have a Types.hpp file in my project. And within it i have:

....    
namespace RC 
{
 .....
 .....

 struct ViewSettings
 {
  ....
 };

 .....
}

In the Server.cpp file I'm including this Types.hpp file, and i have there:

class Session
{
 .....

 RC::ViewSettings tmp;
 boost::asio::async_read(socket_, boost::asio::buffer(&tmp, sizeof(RC::ViewSettings)), 
                         boost::bind(&Session::Finish_Reading_Data, shared_from_this(), boost::asio::placeholders::error));

 .....
}

And during the compilation i have an errors:

 error C2825: 'F': must be a class or namespace when followed by '::'
 : see reference to class template instantiation 'boost::_bi::result_traits<R,F>' 

 being compiled with
 [
  R=boost::_bi::unspecified,
  F=void (__thiscall Session::* )(void)
 ]

 : see reference to class template instantiation 'boost::_bi::bind_t<R,F,L>' 
 being compiled with
 [
  R=boost::_bi::unspecified,
  F=void (__thiscall Session::* )(void),
  L=boost::_bi::list2<boost::_bi::value<boost::shared_ptr<Session>>,boost::arg<1>>
 ]

 error C2039: 'result_type' : is not a member of '`global namespace''

And the code like this works in proper way:

   int w; 
   boost::asio::async_read(socket_, boost::asio::buffer(&w, sizeof(int)), 
                        boost::bind(&Session::Handle_Read_Width, shared_from_this(), boost::asio::placeholders::error));

Please, help. What's the problem here? Thanks in advance.

© Stack Overflow or respective owner

Related posts about boost

Related posts about asio