简体   繁体   中英

boost 1.47 compile error with non_blocking()

Can anyone discern what I'm doing wrong here? According to the documentation in 1.47 basic_datagram_socket inherits from basic_socket so the non_blocking() or non_blocking(bool) should be inherited. Thanks

Error 1 error C2039: 'non_blocking': is not a member of 'boost::asio::basic_datagram_socket' c:\DEV\projects\topoTest\topoTest\multiReceiver.cpp 129

This is the call. socket_.non_blocking(true);

and the socket is defined as follows within a class:

boost::asio::ip::udp::socket socket_;

The member function boost::asio::ip::udp::socket::non_blocking() appears to be new in 1.47. Either it doesn't actually exist in 1.47 or you're actually using an older header. I'd suggest finding the <boost/asio/basic_datagram_socket.hpp> header that's being included to see if it actually has that member function as part of the basic_datagram_socket class.If not, you can always do it the old way like Steve Townsend said in his answer.

I just downloaded Boost 1.47 and found that basic_datagram_socket inherits non_blocking() from basic_socket . It looks to me like you don't actually have Boost 1.47.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM