snowyu / libtorrent

Automatically exported from code.google.com/p/libtorrent
Other
1 stars 0 forks source link

Missing boost::asio library #392

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
1. Build simple_client.cpp with libtorrent
2. Add few line to use boost::asio::deadline_timer

boost::asio::io_service io;
boost::asio::deadline_timer dl(io);
3. I would to use libtorrent as static library, so I use 
BOOST_ASIO_SEPARATE_COMPILATION

What is the expected output? What do you see instead?
There's some components are missing from asio source:

error LNK2019: unresolved external symbol "public: unsigned int __thiscall 
boost::asio::detail::timer_queue<struct boost::asio::time_traits<class 
boost::posix_time::ptime> >::cancel_timer(class 
boost::asio::detail::timer_queue<struct 
boost::asio::detail::forwarding_posix_time_traits>::per_timer_data &,class 
boost::asio::detail::op_queue<class boost::asio::detail::win_iocp_operation> 
&,unsigned int)" 
(?cancel_timer@?$timer_queue@U?$time_traits@Vptime@posix_time@boost@@@asio@boost
@@@detail@asio@boost@@QAEIAAVper_timer_data@?$timer_queue@Uforwarding_posix_time
_traits@detail@asio@boost@@@234@AAV?$op_queue@Vwin_iocp_operation@detail@asio@bo
ost@@@234@I@Z) referenced in function "public: unsigned int __thiscall 
boost::asio::detail::win_iocp_io_service::cancel_timer<struct 
boost::asio::time_traits<class boost::posix_time::ptime> >(class 
boost::asio::detail::timer_queue<struct boost::asio::time_traits<class 
boost::posix_time::ptime> > &,class boost::asio::detail::timer_queue<struct 
boost::asio::detail::forwarding_posix_time_traits>::per_timer_data &,unsigned 
int)" 
(??$cancel_timer@U?$time_traits@Vptime@posix_time@boost@@@asio@boost@@@win_iocp_
io_service@detail@asio@boost@@QAEIAAV?$timer_queue@U?$time_traits@Vptime@posix_t
ime@boost@@@asio@boost@@@123@AAVper_timer_data@?$timer_queue@Uforwarding_posix_t
ime_traits@detail@asio@boost@@@123@I@Z)
error LNK2019: unresolved external symbol "public: virtual __thiscall 
boost::asio::detail::timer_queue<struct boost::asio::time_traits<class 
boost::posix_time::ptime> >::~timer_queue<struct boost::asio::time_traits<class 
boost::posix_time::ptime> >(void)" 
(??1?$timer_queue@U?$time_traits@Vptime@posix_time@boost@@@asio@boost@@@detail@a
sio@boost@@UAE@XZ) referenced in function 
__unwindfunclet$??0?$deadline_timer_service@U?$time_traits@Vptime@posix_time@boo
st@@@asio@boost@@@detail@asio@boost@@QAE@AAVio_service@23@@Z$0
error LNK2019: unresolved external symbol "public: __thiscall 
boost::asio::detail::timer_queue<struct boost::asio::time_traits<class 
boost::posix_time::ptime> >::timer_queue<struct boost::asio::time_traits<class 
boost::posix_time::ptime> >(void)" 
(??0?$timer_queue@U?$time_traits@Vptime@posix_time@boost@@@asio@boost@@@detail@a
sio@boost@@QAE@XZ) referenced in function "public: __thiscall 
boost::asio::detail::deadline_timer_service<struct 
boost::asio::time_traits<class boost::posix_time::ptime> 
>::deadline_timer_service<struct boost::asio::time_traits<class 
boost::posix_time::ptime> >(class boost::asio::io_service &)" 
(??0?$deadline_timer_service@U?$time_traits@Vptime@posix_time@boost@@@asio@boost
@@@detail@asio@boost@@QAE@AAVio_service@23@@Z)

What version of the product are you using? On what operating system?
VS2010, Windows7 64bit, libtorrent 0.16.2

Please provide any additional information below.

Original issue reported on code.google.com by secm...@gmail.com on 29 Nov 2012 at 8:53

GoogleCodeExporter commented 9 years ago
unfortunately boost.asio requires this dependency still (the latest version of 
boost might have this fixed). This problem only manifests itself on windows as 
far as I can tell. You can solve it by linking against boost.date-time (even 
though it's not used).

You may have to use a newer version of libtorrent as well, as I hadn't 
discovered this when 0.16.2 was released.

Original comment by arvid.no...@gmail.com on 30 Nov 2012 at 2:40

GoogleCodeExporter commented 9 years ago

Original comment by arvid.no...@gmail.com on 7 Dec 2012 at 3:20