chriskohlhoff / urdl

Urdl C++ Library - Urdl is a cross-platform C++ library for downloading web content using a URL. It provides an easy-to-use extension to standard C++ iostreams and an asynchronous interface for use with Boost.Asio.
http://think-async.com/Urdl/
Other
110 stars 46 forks source link

Windows internal compile error with URDL and Boost 1.57 #3

Open BobBrownConsulting opened 9 years ago

BobBrownConsulting commented 9 years ago

I'm trying to use URDL from the latest version on Windows in conjunction with Boost 1.57.

When I compile using Visual Studio 2013 I get the following errors...

1>c:\urdl-0.1\include\urdl\detail\file_read_stream.hpp(98): warning C4244: '=' : conversion from 'std::streamsize' to 'size_t', possible loss of data 1> c:\urdl-0.1\include\urdl\detail\file_read_stream.hpp(113) : see reference to function template instantiation 'size_t urdl::detail::file_read_stream::read_some(const MutableBufferSequence &,boost::system::error_code &)' being compiled 1> with 1> [ 1> MutableBufferSequence=boost::asio::mutable_buffers_1 1> ] 1> c:\urdl-0.1\include\urdl\read_stream.hpp(673) : see reference to function template instantiation 'void urdl::detail::file_read_stream::async_read_some<MutableBufferSequence,real_handler_type>(const MutableBufferSequence &,Handler)' being compiled 1> with 1> [ 1> MutableBufferSequence=boost::asio::mutable_buffers_1 1> , Handler=real_handler_type 1> ] 1> c:\urdl-0.1\include\urdl\impl\istreambuf.ipp(201) : see reference to function template instantiation 'boost::asio::async_result::type urdl::read_stream::async_read_someboost::asio::mutable_buffers_1,urdl::detail::istreambuf_read_handler(const MutableBufferSequence &,Handler)' being compiled 1> with 1> [ 1> Handler=urdl::detail::istreambuf_read_handler 1> , MutableBufferSequence=boost::asio::mutable_buffers_1 1> ] 1>c:\urdl-0.1\include\urdl\detail\http_read_stream.hpp(451): warning C4244: '+=' : conversion from 'std::streamsize' to 'size_t', possible loss of data 1> c:\urdl-0.1\include\urdl\detail\http_read_stream.hpp(522) : see reference to function template instantiation 'size_t urdl::detail::http_read_streamboost::asio::ip::tcp::socket::read_some(const MutableBufferSequence &,boost::system::error_code &)' being compiled 1> with 1> [ 1> MutableBufferSequence=boost::asio::mutable_buffers_1 1> ] 1> c:\urdl-0.1\include\urdl\detail\http_read_stream.hpp(522) : see reference to function template instantiation 'size_t urdl::detail::http_read_streamboost::asio::ip::tcp::socket::read_some(const MutableBufferSequence &,boost::system::error_code &)' being compiled 1> with 1> [ 1> MutableBufferSequence=boost::asio::mutable_buffers_1 1> ] 1> c:\urdl-0.1\include\urdl\read_stream.hpp(676) : see reference to function template instantiation 'void urdl::detail::http_read_streamboost::asio::ip::tcp::socket::async_read_some<MutableBufferSequence,real_handler_type>(const MutableBufferSequence &,Handler)' being compiled 1> with 1> [ 1> MutableBufferSequence=boost::asio::mutable_buffers_1 1> , Handler=real_handler_type 1> ] 1> c:\urdl-0.1\include\urdl\read_stream.hpp(676) : see reference to function template instantiation 'void urdl::detail::http_read_streamboost::asio::ip::tcp::socket::async_read_some<MutableBufferSequence,real_handler_type>(const MutableBufferSequence &,Handler)' being compiled 1> with 1> [ 1> MutableBufferSequence=boost::asio::mutable_buffers_1 1> , Handler=real_handler_type 1> ] 1>c:\boost_1_57_0\boost\asio\detail\handler_invoke_helpers.hpp(37): fatal error C1001: An internal error has occurred in the compiler. 1> (compiler file 'msc1.cpp', line 1325) 1> To work around this problem, try simplifying or changing the program near the locations listed above. 1> Please choose the Technical Support command on the Visual C++ 1> Help menu, or open the Technical Support help file for more information 1> c:\boost_1_57_0\boost\asio\detail\wait_handler.hpp(70) : see reference to function template instantiation 'void boost_asio_handler_invoke_helpers::invokeboost::asio::detail::binder1<Handler,boost::system::error_code,Handler>(Function &,Context &)' being compiled 1> with 1> [ 1> Handler=urdl::detail::istreambuf_timeout_handler 1> , Function=boost::asio::detail::binder1urdl::detail::istreambuf_timeout_handler,boost::system::error_code 1> , Context=urdl::detail::istreambuf_timeout_handler 1> ] 1> c:\boost_1_57_0\boost\asio\detail\wait_handler.hpp(47) : while compiling class template member function 'void boost::asio::detail::wait_handler::do_complete(boost::asio::detail::io_service_impl ,boost::asio::detail::operation ,const boost::system::error_code &,size_t)' 1> with 1> [ 1> Handler=urdl::detail::istreambuf_timeout_handler 1> ] 1> c:\boost_1_57_0\boost\asio\detail\wait_handler.hpp(41) : see reference to function template instantiation 'void boost::asio::detail::wait_handler::do_complete(boost::asio::detail::io_service_impl ,boost::asio::detail::operation ,const boost::system::error_code &,size_t)' being compiled 1> with 1> [ 1> Handler=urdl::detail::istreambuf_timeout_handler 1> ] 1> c:\boost_1_57_0\boost\asio\detail\deadline_timer_service.hpp(183) : see reference to class template instantiation 'boost::asio::detail::wait_handler' being compiled 1> with 1> [ 1> Handler=urdl::detail::istreambuf_timeout_handler 1> ] 1> c:\boost_1_57_0\boost\asio\deadline_timer_service.hpp(149) : see reference to function template instantiation 'void boost::asio::detail::deadline_timer_serviceboost::asio::time_traits::async_waiturdl::detail::istreambuf_timeout_handler(boost::asio::detail::deadline_timer_serviceboost::asio::time_traits::implementation_type &,Handler &)' being compiled 1> with 1> [ 1> Handler=urdl::detail::istreambuf_timeout_handler 1> ] 1> c:\boost_1_57_0\boost\asio\deadline_timer_service.hpp(149) : see reference to function template instantiation 'void boost::asio::detail::deadline_timer_serviceboost::asio::time_traits::async_waiturdl::detail::istreambuf_timeout_handler(boost::asio::detail::deadline_timer_serviceboost::asio::time_traits::implementation_type &,Handler &)' being compiled 1> with 1> [ 1> Handler=urdl::detail::istreambuf_timeout_handler 1> ] 1> c:\boost_1_57_0\boost\asio\basic_deadline_timer.hpp(508) : see reference to function template instantiation 'boost::asio::async_result::type boost::asio::deadline_timer_service<Time,TimeTraits>::async_waiturdl::detail::istreambuf_timeout_handler&(boost::asio::detail::deadline_timer_serviceboost::asio::time_traits::implementation_type &,WaitHandler)' being compiled 1> with 1> [ 1> Handler=urdl::detail::istreambuf_timeout_handler 1> , Time=boost::posix_time::ptime 1> , TimeTraits=boost::asio::time_traitsboost::posix_time::ptime 1> , WaitHandler=urdl::detail::istreambuf_timeout_handler & 1> ] 1> c:\boost_1_57_0\boost\asio\basic_deadline_timer.hpp(508) : see reference to function template instantiation 'boost::asio::async_result::type boost::asio::deadline_timer_service<Time,TimeTraits>::async_waiturdl::detail::istreambuf_timeout_handler&(boost::asio::detail::deadline_timer_serviceboost::asio::time_traits::implementation_type &,WaitHandler)' being compiled 1> with 1> [ 1> Handler=urdl::detail::istreambuf_timeout_handler 1> , Time=boost::posix_time::ptime 1> , TimeTraits=boost::asio::time_traitsboost::posix_time::ptime 1> , WaitHandler=urdl::detail::istreambuf_timeout_handler & 1> ] 1> c:\urdl-0.1\include\urdl\impl\istreambuf.ipp(126) : see reference to function template instantiation 'boost::asio::async_result::type boost::asio::basic_deadline_timerboost::posix_time::ptime,boost::asio::time_traits<boost::posix_time::ptime,boost::asio::deadline_timer_service<Time,TimeTraits>>::async_waiturdl::detail::istreambuf_timeout_handler&(WaitHandler)' being compiled 1> with 1> [ 1> Handler=urdl::detail::istreambuf_timeout_handler 1> , Time=boost::posix_time::ptime 1> , TimeTraits=boost::asio::time_traitsboost::posix_time::ptime 1> , WaitHandler=urdl::detail::istreambuf_timeout_handler & 1> ] 1> c:\urdl-0.1\include\urdl\impl\istreambuf.ipp(126) : see reference to function template instantiation 'boost::asio::async_result::type boost::asio::basic_deadline_timerboost::posix_time::ptime,boost::asio::time_traits<boost::posix_time::ptime,boost::asio::deadline_timer_service<Time,TimeTraits>>::async_waiturdl::detail::istreambuf_timeout_handler&(WaitHandler)' being compiled 1> with 1> [ 1> Handler=urdl::detail::istreambuf_timeout_handler 1> , Time=boost::posix_time::ptime 1> , TimeTraits=boost::asio::time_traitsboost::posix_time::ptime 1> , WaitHandler=urdl::detail::istreambuf_timeout_handler & 1> ] 1> INTERNAL COMPILER ERROR in 'C:\Program Files\Microsoft Visual Studio 12.0\VC\bin\CL.exe' 1> Please choose the Technical Support command on the Visual C++ 1> Help menu, or open the Technical Support help file for more information

maksqwe commented 9 years ago

Confirm :(

maksqwe commented 9 years ago
    boost::asio::io_service io_service;
    urdl::read_stream stream(io_service);
    stream.open("url");

More readable error output:

D:\Dev\libs\boost_1_58_0b\boost/asio/detail/handler_invoke_helpers.hpp(37): fatal error C1001: An internal error has occurred in the compiler.
  (compiler file 'msc1.cpp', line 1325)
   To work around this problem, try simplifying or changing the program near the locations listed above.
  Please choose the Technical Support command on the Visual C++ 
   Help menu, or open the Technical Support help file for more information
          D:\Dev\libs\boost_1_58_0b\boost/asio/detail/wait_handler.hpp(70) : see reference to function template instantiation 'void boost_asio_handler_invoke_helpers::invoke<boost::asio::detail::binder1<Handler,boost::system::error_code>,Handler>(Function &,Context &)' being compiled
          with
          [
              Handler=urdl::detail::istreambuf_timeout_handler
  ,            Function=boost::asio::detail::binder1<urdl::detail::istreambuf_timeout_handler,boost::system::error_code>
  ,            Context=urdl::detail::istreambuf_timeout_handler
          ]
          D:\Dev\libs\boost_1_58_0b\boost/asio/detail/wait_handler.hpp(47) : while compiling class template member function 'void boost::asio::detail::wait_handler<Handler>::do_complete(boost::asio::detail::io_service_impl *,boost::asio::detail::operation *,const boost::system::error_code &,size_t)'
          with
          [
              Handler=urdl::detail::istreambuf_timeout_handler
          ]
          D:\Dev\libs\boost_1_58_0b\boost/asio/detail/wait_handler.hpp(41) : see reference to function template instantiation 'void boost::asio::detail::wait_handler<Handler>::do_complete(boost::asio::detail::io_service_impl *,boost::asio::detail::operation *,const boost::system::error_code &,size_t)' being compiled
          with
          [
              Handler=urdl::detail::istreambuf_timeout_handler
          ]
          D:\Dev\libs\boost_1_58_0b\boost/asio/detail/deadline_timer_service.hpp(183) : see reference to class template instantiation 'boost::asio::detail::wait_handler<Handler>' being compiled
          with
          [
              Handler=urdl::detail::istreambuf_timeout_handler
          ]
          D:\Dev\libs\boost_1_58_0b\boost/asio/deadline_timer_service.hpp(149) : see reference to function template instantiation 'void boost::asio::detail::deadline_timer_service<boost::asio::time_traits<boost::posix_time::ptime>>::async_wait<urdl::detail::istreambuf_timeout_handler>(boost::asio::detail::deadline_timer_service<boost::asio::time_traits<boost::posix_time::ptime>>::implementation_type &,Handler &)' being compiled
          with
          [
              Handler=urdl::detail::istreambuf_timeout_handler
          ]
          D:\Dev\libs\boost_1_58_0b\boost/asio/deadline_timer_service.hpp(149) : see reference to function template instantiation 'void boost::asio::detail::deadline_timer_service<boost::asio::time_traits<boost::posix_time::ptime>>::async_wait<urdl::detail::istreambuf_timeout_handler>(boost::asio::detail::deadline_timer_service<boost::asio::time_traits<boost::posix_time::ptime>>::implementation_type &,Handler &)' being compiled
          with
          [
              Handler=urdl::detail::istreambuf_timeout_handler
          ]
          D:\Dev\libs\boost_1_58_0b\boost/asio/basic_deadline_timer.hpp(508) : see reference to function template instantiation 'boost::asio::async_result<Handler>::type boost::asio::deadline_timer_service<Time,TimeTraits>::async_wait<urdl::detail::istreambuf_timeout_handler&>(boost::asio::detail::deadline_timer_service<boost::asio::time_traits<boost::posix_time::ptime>>::implementation_type &,WaitHandler)' being compiled
          with
          [
              Handler=urdl::detail::istreambuf_timeout_handler
  ,            Time=boost::posix_time::ptime
  ,            TimeTraits=boost::asio::time_traits<boost::posix_time::ptime>
  ,            WaitHandler=urdl::detail::istreambuf_timeout_handler &
          ]
          D:\Dev\libs\boost_1_58_0b\boost/asio/basic_deadline_timer.hpp(508) : see reference to function template instantiation 'boost::asio::async_result<Handler>::type boost::asio::deadline_timer_service<Time,TimeTraits>::async_wait<urdl::detail::istreambuf_timeout_handler&>(boost::asio::detail::deadline_timer_service<boost::asio::time_traits<boost::posix_time::ptime>>::implementation_type &,WaitHandler)' being compiled
          with
          [
              Handler=urdl::detail::istreambuf_timeout_handler
  ,            Time=boost::posix_time::ptime
  ,            TimeTraits=boost::asio::time_traits<boost::posix_time::ptime>
  ,            WaitHandler=urdl::detail::istreambuf_timeout_handler &
          ]
          D:\Dev\libs\urdl\include\urdl/impl/istreambuf.ipp(126) : see reference to function template instantiation 'boost::asio::async_result<Handler>::type boost::asio::basic_deadline_timer<boost::posix_time::ptime,boost::asio::time_traits<boost::posix_time::ptime>,boost::asio::deadline_timer_service<Time,TimeTraits>>::async_wait<urdl::detail::istreambuf_timeout_handler&>(WaitHandler)' being compiled
          with
          [
              Handler=urdl::detail::istreambuf_timeout_handler
  ,            Time=boost::posix_time::ptime
  ,            TimeTraits=boost::asio::time_traits<boost::posix_time::ptime>
  ,            WaitHandler=urdl::detail::istreambuf_timeout_handler &
          ]
          D:\Dev\libs\urdl\include\urdl/impl/istreambuf.ipp(126) : see reference to function template instantiation 'boost::asio::async_result<Handler>::type boost::asio::basic_deadline_timer<boost::posix_time::ptime,boost::asio::time_traits<boost::posix_time::ptime>,boost::asio::deadline_timer_service<Time,TimeTraits>>::async_wait<urdl::detail::istreambuf_timeout_handler&>(WaitHandler)' being compiled
          with
          [
              Handler=urdl::detail::istreambuf_timeout_handler
  ,            Time=boost::posix_time::ptime
  ,            TimeTraits=boost::asio::time_traits<boost::posix_time::ptime>
  ,            WaitHandler=urdl::detail::istreambuf_timeout_handler &
          ]
kolobok55 commented 9 years ago

I have the same problem