Boost logo

Boost :

Subject: [boost] [ASIO] 1.70.0 async_read_until reports undefined symbol with MSVS 2010
From: Kenneth Porter (shiva_at_[hidden])
Date: 2019-04-14 17:22:19


The following test code (inside #if 1) generates a LNK2019 (unresolved
external symbol) with 1.70.0 but links successfully with 1.69.0. Inspecting
read_until.hpp, I suspect the problem is with the enable_if expansion being
too complex for the older compiler. (Hence the #if0 code which tests the
individual conditions, but those seem to work fine.) The same code links
with VS2019 and VS2015, and this linked under the previous Boost with
VS2010.

int _tmain(int argc, _TCHAR* argv[])
{
   typedef boost::asio::streambuf buftype;
#if 0
   const bool v1 = boost::asio::is_dynamic_buffer_v1<typename
boost::decay<buftype>::type>::value;
   const bool notv2 = !boost::asio::is_dynamic_buffer_v2<typename
boost::decay<buftype>::type>::value;
#endif
#if 0
   void* cond = boost::enable_if<
                boost::asio::is_dynamic_buffer_v1<typename
boost::decay<buftype>::type>::value
                && !boost::asio::is_dynamic_buffer_v2<typename
boost::decay<buftype>::type>::value
>::type* 0;
#endif
#if 1
   boost::asio::io_service ios;
   boost::asio::ip::tcp::socket socket(ios);
   boost::asio::streambuf buf;
   boost::asio::async_read_until(socket, buf, '\n', NULL);
#endif
   return 0;
}


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk