For gcc4.6 use -std=c++0x
~/asio-1.5.3$ ./configure --with-openssl=/usr/include/openssl/ CXXFLAGS=-std=c++11
[...]
~/asio-1.5.3$ make
[...]
./../include/asio/impl/error_code.ipp:36:15: error: looser throw specifier for ‘virtual const char asio::detail::system_category::name() const’
[...]
/usr/include/c++/4.7/system_error:78:5: error: overriding ‘virtual const char std::error_category::name() const noexcept (true)’
[...]
./../include/asio/impl/error.ipp:33:15: error: looser throw specifier for ‘virtual const char asio::error::detail::netdb_category::name() const’
[...]
/usr/include/c++/4.7/system_error:78:5: error: overriding ‘virtual const char std::error_category::name() const noexcept (true)’
[... and so on...]
After fix them next problem is:
~/asio-1.5.3$ make
[...]
In file included from ./../include/asio/ssl/context.hpp:528:0,
from ./../include/asio/ssl.hpp:19,
from examples/ssl/client.cpp:15:
./../include/asio/ssl/impl/context.ipp: In constructor ‘asio::ssl::context::context(asio::ssl::context_base::method)’:
./../include/asio/ssl/impl/context.ipp:42:29: error: ‘::SSLv2_method’ has not been declared
./../include/asio/ssl/impl/context.ipp:45:29: error: ‘::SSLv2_client_method’ has not been declared
./../include/asio/ssl/impl/context.ipp:48:29: error: ‘::SSLv2_server_method’ has not been declared
make[1]: *** [examples/ssl/client.o] Error 1
make[1]: Leaving directory `/home/user/documents/distr/asio-1.5.3/src'
make: *** [all-recursive] Error 1
So there is a patch: asio-1.5.3.patch