How is asio::error supposed to work? Tutorial is generating compiler errors

I am trying to compile the tutorial for boost asio, specifically the daytime client (http://asio.sourceforge.net/asio-0.3.7/doc/tutorial/tutdaytime1.html). The following line generates a compile time error. Compiler is VC8. Maybe I'm missing something but is this tutorial out of date? Because I also don't see any implementation of assign_error method which is also liberally used throughout the explanations on that page. boost::asio::error error = boost::asio::error::host_not_found; error C2440: 'initializing' : cannot convert from 'const boost::system::error_code' to 'boost::asio::error' 1> No constructor could take the source type, or constructor overload resolution was ambiguous ____________________________________________________________________________________ Got a little couch potato? Check out fun summer activities for kids. http://search.yahoo.com/search?fr=oni_on_mail&p=summer+activities+for+kids&cs=bz

I believe this is one of the areas that changed in the Boost fork of ASIO, which it sounds like you might be using. I recommend trying this documentation, instead: http://asio.sourceforge.net/boost_asio_0_3_7/libs/asio/doc/ Matt console shark wrote:
I am trying to compile the tutorial for boost asio, specifically the daytime client (http://asio.sourceforge.net/asio-0.3.7/doc/tutorial/tutdaytime1.html).
The following line generates a compile time error. Compiler is VC8.
Maybe I'm missing something but is this tutorial out of date? Because I also don't see any implementation of assign_error method which is also liberally used throughout the explanations on that page. boost::asio::error error = boost::asio::error::host_not_found; http://asio.sourceforge.net/asio-0.3.7/doc/reference/a00135.html
error C2440: 'initializing' : cannot convert from 'const boost::system::error_code' to 'boost::asio::error' 1> No constructor could take the source type, or constructor overload resolution was ambiguous

Oops. That seems to be out of date (I'm still using the non-boost ASIO branch, so I didn't realize the online docs lacked some of the boost changes). Fortunately, the latest docs are included in the source package. From where you unzipped the sources, the docs can be found in: boost_asio_0_3_8rc3/libs/asio/doc/html/boost_asio/tutorial/tutdaytime1.html Matt Matt Gruenke wrote:
I believe this is one of the areas that changed in the Boost fork of ASIO, which it sounds like you might be using. I recommend trying this documentation, instead:
http://asio.sourceforge.net/boost_asio_0_3_7/libs/asio/doc/
Matt
participants (2)
-
console shark
-
Matt Gruenke