I’m new on boost.asio.
I have a problem when I try a simple example.
in my header file I have:
#include <boost/asio.hpp>
#include "boost/bind.hpp"
#include "boost/date_time/posix_time/posix_time_types.hpp"
and I need this private variable:
boost::asio::ip::udp::socket socket_;
I have this error at compile time:
error C2512: 'boost::asio::basic_datagram_socket<Protocol>' : no appropriate default constructor available
with
[
Protocol=boost::asio::ip::udp
The list of all UDP socket constructors if found here. As you can see, you must provide at least a reference to a
boost::asio::io_serviceobject.If this is a private variable, provide this reference in the class constructor’s initializer list. The following will compile: