With desperate battle with Boost.Asio, i met a lot of difficulties.
One of them is that i can hardly locate where the "boost::noncopyable errors" are!!
If i violate the noncopyable regulation accidently, IDE only shows me some errors in noncopyable.hpp or somewhere else but nowhere in my files.
I can only find errors by comment&uncomment everywhere asio object exist.
(ps: my IDE is visual c++ 2008, is this IDE has bad relationship with Boost??)
EDIT:
I know that reading the whole error message helps alot. But how about this?
1>d:\boost\include\boost-1_42\boost\asio\basic_io_object.hpp(92) : error C2248: 'boost::noncopyable_::noncopyable::noncopyable' : cannot access private member declared in class 'boost::noncopyable_::noncopyable'
1> d:\boost\include\boost-1_42\boost\noncopyable.hpp(27) : see declaration of 'boost::noncopyable_::noncopyable::noncopyable'
1> d:\boost\include\boost-1_42\boost\noncopyable.hpp(22) : see declaration of 'boost::noncopyable_::noncopyable'
1> This diagnostic occurred in the compiler generated function 'boost::asio::basic_io_object<IoObjectService>::basic_io_object(const boost::asio::basic_io_object<IoObjectService> &)'
1> with
1> [ IoObjectService=boost::asio::stream_socket_service<boost::asio::ip::tcp> ]
It's all caused by this
tcp::socket getSocket(){
return m_socket;
}
(it should be:
tcp::socket& getSocket(){
return m_socket;
}
)
When there are many functions in that file, can you guys quickly find it??
(ps2: perhaps all these troubles are caused by my pooooooor c++ programming experience??)