Opened 12 years ago

Closed 12 years ago

Last modified 10 years ago

#4196 closed Bugs (invalid)

Code does not compile when using boost::asio::local::stream_protocol::iostream

Reported by: Hannes Brandstätter-Müller <hannes.mueller@…> Owned by: chris_kohlhoff
Milestone: Boost 1.43.0 Component: asio
Version: Boost 1.42.0 Severity: Showstopper
Keywords: Cc:

Description

I found a reference to this problem on this page. Unfortunately, there was no solution there to be found.

I get the following errors when trying to use

asio::local::stream_protocol::iostream stream_;

initialization in the constructor of my class as:

myclass::myclass(const std::string& file) : stream_(file) {}

Errors:

/usr/local/include/boost/asio/basic_socket_streambuf.hpp: In member function ‘boost::asio::basic_socket_streambuf<Protocol, StreamSocketService>* boost::asio::basic_socket_streambuf<Protocol, StreamSocketService>::connect(T0) [with T0 = std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Protocol = boost::asio::local::stream_protocol, StreamSocketService = boost::asio::stream_socket_service<boost::asio::local::stream_protocol>]’:
/usr/local/include/boost/asio/basic_socket_iostream.hpp:114:   instantiated from ‘boost::asio::basic_socket_iostream<Protocol, StreamSocketService>::basic_socket_iostream(T0) [with T0 = std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Protocol = boost::asio::local::stream_protocol, StreamSocketService = boost::asio::stream_socket_service<boost::asio::local::stream_protocol>]’
myclass.cpp:14:   instantiated from here
/usr/local/include/boost/asio/basic_socket_streambuf.hpp:139: error: no type named ‘resolver_query’ in ‘class boost::asio::local::stream_protocol’
make: *** [myclass.o] Error 1

Change History (2)

comment:1 by chris_kohlhoff, 12 years ago

Resolution: invalid
Status: newclosed

As discussed elsewhere, the correct use is illustrated by the local/iostream_client.cpp example.

comment:2 by anonymous, 10 years ago

boost::asio::local::stream_protocol is posix system specific, it cannot be used in windows, are u compiling it in windows? Please go for linux.

Note: See TracTickets for help on using tickets.