
программист-самоучка
 
Профиль
Группа: Участник
Сообщений: 699
Регистрация: 12.1.2008
Где: ++Украина.Крым++
Репутация: нет Всего: 13
|
Собрал буст последнюю версию (1.39), но не получается скомпилить пример из boost::asio - chat_server, вываливается целая куча ошибок: | Код | g++.exe "C:\libs\boost_1_39_0\doc\html\boost_asio\example\chat\chat_server.cpp" -o "C:\libs\boost_1_39_0\doc\html\boost_asio\example\chat\chat_server.exe" -D_WIN32_WINNT=0x0501 -I"C:\Dev-Cpp\lib\gcc\mingw32\3.4.2\include" -I"C:\Dev-Cpp\include\c++\3.4.2\backward" -I"C:\Dev-Cpp\include\c++\3.4.2\mingw32" -I"C:\Dev-Cpp\include\c++\3.4.2" -I"C:\Dev-Cpp\include" -I"F:\LIBRARIES\boost_1_39_0" -L"C:\Dev-Cpp\lib" -L"C:\libs\boost_1_39_0\stage\lib" C:\libs\boost_1_39_0\stage\lib\libboost_system-mgw34-1_39.lib In file included from F:/LIBRARIES/boost_1_39_0/boost/date_time/microsec_time_clock.hpp:23, from F:/LIBRARIES/boost_1_39_0/boost/date_time/posix_time/posix_time_types.hpp:11, from F:/LIBRARIES/boost_1_39_0/boost/asio/detail/select_reactor.hpp:25, from F:/LIBRARIES/boost_1_39_0/boost/asio/impl/io_service.ipp:27,
from F:/LIBRARIES/boost_1_39_0/boost/asio/io_service.hpp:550,
from F:/LIBRARIES/boost_1_39_0/boost/asio/basic_io_object.hpp:20, from F:/LIBRARIES/boost_1_39_0/boost/asio/basic_socket.hpp:24, from F:/LIBRARIES/boost_1_39_0/boost/asio/basic_datagram_socket.hpp:25, from F:/LIBRARIES/boost_1_39_0/boost/asio.hpp:20, from C:\libs\boost_1_39_0\doc\html\boost_asio\example\chat\chat_server.cpp:20: F:/LIBRARIES/boost_1_39_0/boost/date_time/filetime_functions.hpp: In function `uint64_t boost::date_time::winapi::file_time_to_microseconds(const FileTimeT&)': F:/LIBRARIES/boost_1_39_0/boost/date_time/filetime_functions.hpp:101: warning: left shift count >= width of type
C:\DOCUME~1\User\LOCALS~1\Temp/ccQbidaa.o(.text$_ZN5boost4asio6detail10socket_ops21host_to_network_shortEt[boost::asio::detail::socket_ops::host_to_network_short(unsigned short)]+0x15):chat_server.cpp: undefined reference to `htons@4' C:\DOCUME~1\User\LOCALS~1\Temp/ccQbidaa.o(.text$_ZN5boost4asio6detail12winsock_initILi2ELi0EE7do_initC1Ev[boost::asio::detail::winsock_init<2, 0>::do_init::do_init()]+0x1f):chat_server.cpp: undefined reference to `WSAStartup@8'
C:\DOCUME~1\User\LOCALS~1\Temp/ccQbidaa.o(.text$_ZN5boost4asio6detail10socket_ops5closeEjRNS_6system10error_codeE[boost::asio::detail::socket_ops::close(unsigned int, boost::system::error_code&)]+0x18):chat_server.cpp: undefined reference to `closesocket@4' C:\DOCUME~1\User\LOCALS~1\Temp/ccQbidaa.o(.text$_ZN5boost4asio6detail10socket_ops13error_wrapperIiEET_S4_RNS_6system10error_codeE[int boost::asio::detail::socket_ops::error_wrapper<int>(int, boost::system::error_code&)]+0x13):chat_server.cpp: undefined reference to `WSAGetLastError@0' C:\DOCUME~1\User\LOCALS~1\Temp/ccQbidaa.o(.text$_ZN5boost4asio6detail10socket_ops11clear_errorERNS_6system10error_codeE[boost::asio::detail::socket_ops::clear_error(boost::system::error_code&)]+0xf):chat_server.cpp: undefined reference to `WSASetLastError@4' C:\DOCUME~1\User\LOCALS~1\Temp/ccQbidaa.o(.text$_ZN5boost4asio6detail10socket_ops6socketEiiiRNS_6system10error_codeE[boost::asio::detail::socket_ops::socket(int, int, int, boost::system::error_code&)]+0x3e):chat_server.cpp: undefined reference to `WSASocketA@24' C:\DOCUME~1\User\LOCALS~1\Temp/ccQbidaa.o(.text$_ZN5boost4asio6detail10socket_ops6socketEiiiRNS_6system10error_codeE[boost::asio::detail::socket_ops::socket(int, int, int, boost::system::error_code&)]+0x9a):chat_server.cpp: undefined reference to `setsockopt@20' C:\DOCUME~1\User\LOCALS~1\Temp/ccQbidaa.o(.text$_ZN5boost4asio6detail10socket_ops13error_wrapperIjEET_S4_RNS_6system10error_codeE[unsigned int boost::asio::detail::socket_ops::error_wrapper<unsigned int>(unsigned int, boost::system::error_code&)]+0x13):chat_server.cpp: undefined reference to `WSAGetLastError@0'
C:\DOCUME~1\User\LOCALS~1\Temp/ccQbidaa.o(.text$_ZN5boost4asio6detail10socket_ops15call_setsockoptIiEEiMNS2_6msghdrET_jiiPKvj[int boost::asio::detail::socket_ops::call_setsockopt<int>(int boost::asio::detail::socket_ops::msghdr::*, unsigned int, int, int, void const*, unsigned int)]+0x29):chat_server.cpp: undefined reference to `setsockopt@20' C:\DOCUME~1\User\LOCALS~1\Temp/ccQbidaa.o(.text$_ZN5boost4asio6detail10socket_ops9call_bindIiEEiMNS2_6msghdrET_jPK8sockaddrj[int boost::asio::detail::socket_ops::call_bind<int>(int boost::asio::detail::socket_ops::msghdr::*, unsigned int, sockaddr const*, unsigned int)]+0x1b):chat_server.cpp: undefined reference to `bind@12' C:\DOCUME~1\User\LOCALS~1\Temp/ccQbidaa.o(.text$_ZN5boost4asio6detail10socket_ops6listenEjiRNS_6system10error_codeE[boost::asio::detail::socket_ops::listen(unsigned int, int, boost::system::error_code&)]+0x1f):chat_server.cpp: undefined reference to `listen@8' C:\DOCUME~1\User\LOCALS~1\Temp/ccQbidaa.o(.text$_ZN5boost4asio6detail23win_iocp_socket_serviceINS0_2ip3tcpEE12async_acceptINS0_12basic_socketIS4_NS0_21stream_socket_serviceIS4_EEEENS_3_bi6bind_tIvNS_4_mfi3mf2Iv11chat_serverNS_10shared_ptrI12chat_sessionEERKNS_6system10error_codeEEENSB_5list3INSB_5valueIPSF_EENSP_ISI_EEPFNS_3argILi1EEEvEEEEEEEvRNS5_19implementation_typeERT_PNS3_14basic_endpointIS4_EET0_[void boost::asio::detail::win_iocp_socket_service<boost::asio::ip::tcp>::async_accept<boost::asio::basic_socket<boost::asio::ip::tcp, boost::asio::stream_socket_service<boost::asio::ip::tcp> >, boost::_bi::bind_t<void, boost::_mfi::mf2<void, chat_server, boost::shared_ptr<chat_session>, boost::system::error_code const&>, boost::_bi::list3<boost::_bi::value<chat_server*>, boost::_bi::value<boost::shared_ptr<chat_session> >, boost::arg<1> (*)()> > >(boost::asio::detail::win_iocp_socket_service<boost::asio::ip::tcp>::implementation_type&, boost::asio::basic_socket<boost::asio::ip::tcp, boost::asio::stream_socket_service<boost::asio::ip::tcp> >&, boost::asio::ip::basic_endpoint<boost::asio::ip::tcp>*, boost::_bi::bind_t<void, boost::_mfi::mf2<void, chat_server, boost::shared_ptr<chat_session>, boost::system::error_code const&>, boost::_bi::list3<boost::_bi::value<chat_server*>, boost::_bi::value<boost::shared_ptr<chat_session> >, boost::arg<1> (*)()> >)]+0x4d0):chat_server.cpp: undefined reference to `AcceptEx@32' C:\DOCUME~1\User\LOCALS~1\Temp/ccQbidaa.o(.text$_ZN5boost4asio6detail23win_iocp_socket_serviceINS0_2ip3tcpEE12async_acceptINS0_12basic_socketIS4_NS0_21stream_socket_serviceIS4_EEEENS_3_bi6bind_tIvNS_4_mfi3mf2Iv11chat_serverNS_10shared_ptrI12chat_sessionEERKNS_6system10error_codeEEENSB_5list3INSB_5valueIPSF_EENSP_ISI_EEPFNS_3argILi1EEEvEEEEEEEvRNS5_19implementation_typeERT_PNS3_14basic_endpointIS4_EET0_[void boost::asio::detail::win_iocp_socket_service<boost::asio::ip::tcp>::async_accept<boost::asio::basic_socket<boost::asio::ip::tcp, boost::asio::stream_socket_service<boost::asio::ip::tcp> >, boost::_bi::bind_t<void, boost::_mfi::mf2<void, chat_server, boost::shared_ptr<chat_session>, boost::system::error_code const&>, boost::_bi::list3<boost::_bi::value<chat_server*>, boost::_bi::value<boost::shared_ptr<chat_session> >, boost::arg<1> (*)()> > >(boost::asio::detail::win_iocp_socket_service<boost::asio::ip::tcp>::implementation_type&, boost::asio::basic_socket<boost::asio::ip::tcp, boost::asio::stream_socket_service<boost::asio::ip::tcp> >&, boost::asio::ip::basic_endpoint<boost::asio::ip::tcp>*, boost::_bi::bind_t<void, boost::_mfi::mf2<void, chat_server, boost::shared_ptr<chat_session>, boost::system::error_code const&>, boost::_bi::list3<boost::_bi::value<chat_server*>, boost::_bi::value<boost::shared_ptr<chat_session> >, boost::arg<1> (*)()> >)]+0x4de):chat_server.cpp: undefined reference to `WSAGetLastError@0' C:\DOCUME~1\User\LOCALS~1\Temp/ccQbidaa.o(.text$_ZN5boost4asio6detail23win_iocp_socket_serviceINS0_2ip3tcpEE13async_receiveINS1_17consuming_buffersINS0_14mutable_bufferENS0_17mutable_buffers_1EEENS1_12read_handlerINS0_19basic_stream_socketIS4_NS0_21stream_socket_serviceIS4_EEEES9_NS1_14transfer_all_tENS_3_bi6bind_tIvNS_4_mfi3mf1Iv12chat_sessionRKNS_6system10error_codeEEENSH_5list2INSH_5valueINS_10shared_ptrISL_EEEEPFNS_3argILi1EEEvEEEEEEEEEvRNS5_19implementation_typeERKT_iT0_[void boost::asio::detail::win_iocp_socket_service<boost::asio::ip::tcp>::async_receive<boost::asio::detail::consuming_buffers<boost::asio::mutable_buffer, boost::asio::mutable_buffers_1>, boost::asio::detail::read_handler<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::stream_socket_service<boost::asio::ip::tcp> >, boost::asio::mutable_buffers_1, boost::asio::detail::transfer_all_t, boost::_bi::bind_t<void, boost::_mfi::mf1<void, chat_session, boost::system::error_code const&>, boost::_bi::list2<boost::_bi::value<boost::shared_ptr<chat_session> >, boost::arg<1> (*)()> > > >(boost::asio::detail::win_iocp_socket_service<boost::asio::ip::tcp>::implementation_type&, boost::asio::detail::consuming_buffers<boost::asio::mutable_buffer, boost::asio::mutable_buffers_1> const&, int, boost::asio::detail::read_handler<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::stream_socket_service<boost::asio::ip::tcp> >, boost::asio::mutable_buffers_1, boost::asio::detail::transfer_all_t, boost::_bi::bind_t<void, boost::_mfi::mf1<void, chat_session, boost::system::error_code const&>, boost::_bi::list2<boost::_bi::value<boost::shared_ptr<chat_session> >, boost::arg<1> (*)()> > >)]+0x4da):chat_server.cpp: undefined reference to `WSARecv@28'
C:\DOCUME~1\User\LOCALS~1\Temp/ccQbidaa.o(.text$_ZN5boost4asio6detail23win_iocp_socket_serviceINS0_2ip3tcpEE13async_receiveINS1_17consuming_buffersINS0_14mutable_bufferENS0_17mutable_buffers_1EEENS1_12read_handlerINS0_19basic_stream_socketIS4_NS0_21stream_socket_serviceIS4_EEEES9_NS1_14transfer_all_tENS_3_bi6bind_tIvNS_4_mfi3mf1Iv12chat_sessionRKNS_6system10error_codeEEENSH_5list2INSH_5valueINS_10shared_ptrISL_EEEEPFNS_3argILi1EEEvEEEEEEEEEvRNS5_19implementation_typeERKT_iT0_[void boost::asio::detail::win_iocp_socket_service<boost::asio::ip::tcp>::async_receive<boost::asio::detail::consuming_buffers<boost::asio::mutable_buffer, boost::asio::mutable_buffers_1>, boost::asio::detail::read_handler<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::stream_socket_service<boost::asio::ip::tcp> >, boost::asio::mutable_buffers_1, boost::asio::detail::transfer_all_t, boost::_bi::bind_t<void, boost::_mfi::mf1<void, chat_session, boost::system::error_code const&>, boost::_bi::list2<boost::_bi::value<boost::shared_ptr<chat_session> >, boost::arg<1> (*)()> > > >(boost::asio::detail::win_iocp_socket_service<boost::asio::ip::tcp>::implementation_type&, boost::asio::detail::consuming_buffers<boost::asio::mutable_buffer, boost::asio::mutable_buffers_1> const&, int, boost::asio::detail::read_handler<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::stream_socket_service<boost::asio::ip::tcp> >, boost::asio::mutable_buffers_1, boost::asio::detail::transfer_all_t, boost::_bi::bind_t<void, boost::_mfi::mf1<void, chat_session, boost::system::error_code const&>, boost::_bi::list2<boost::_bi::value<boost::shared_ptr<chat_session> >, boost::arg<1> (*)()> > >)]+0x4e8):chat_server.cpp: undefined reference to `WSAGetLastError@0' C:\DOCUME~1\User\LOCALS~1\Temp/ccQbidaa.o(.text$_ZN5boost4asio6detail12winsock_initILi2ELi0EE7do_initD1Ev[boost::asio::detail::winsock_init<2, 0>::do_init::~do_init()]+0x7):chat_server.cpp: undefined reference to `WSACleanup@0' C:\DOCUME~1\User\LOCALS~1\Temp/ccQbidaa.o(.text$_ZN5boost4asio6detail10socket_ops4sendEjPK7_WSABUFjiRNS_6system10error_codeE[boost::asio::detail::socket_ops::send(unsigned int, _WSABUF const*, unsigned int, int, boost::system::error_code&)]+0x57):chat_server.cpp: undefined reference to `WSASend@28' C:\DOCUME~1\User\LOCALS~1\Temp/ccQbidaa.o(.text$_ZN5boost4asio6detail23win_iocp_socket_serviceINS0_2ip3tcpEE16accept_operationINS0_12basic_socketIS4_NS0_21stream_socket_serviceIS4_EEEENS_3_bi6bind_tIvNS_4_mfi3mf2Iv11chat_serverNS_10shared_ptrI12chat_sessionEERKNS_6system10error_codeEEENSB_5list3INSB_5valueIPSF_EENSP_ISI_EEPFNS_3argILi1EEEvEEEEEE18do_completion_implEPNS1_19win_iocp_io_service9operationEmj[boost::asio::detail::win_iocp_socket_service<boost::asio::ip::tcp>::accept_operation<boost::asio::basic_socket<boost::asio::ip::tcp, boost::asio::stream_socket_service<boost::asio::ip::tcp> >, boost::_bi::bind_t<void, boost::_mfi::mf2<void, chat_server, boost::shared_ptr<chat_session>, boost::system::error_code const&>, boost::_bi::list3<boost::_bi::value<chat_server*>, boost::_bi::value<boost::shared_ptr<chat_session> >, boost::arg<1> (*)()> > >::do_completion_impl(boost::asio::detail::win_iocp_io_service::operation*, unsigned long, unsigned int)]+0x2ae):chat_server.cpp: undefined reference to `AcceptEx@32' C:\DOCUME~1\User\LOCALS~1\Temp/ccQbidaa.o(.text$_ZN5boost4asio6detail23win_iocp_socket_serviceINS0_2ip3tcpEE16accept_operationINS0_12basic_socketIS4_NS0_21stream_socket_serviceIS4_EEEENS_3_bi6bind_tIvNS_4_mfi3mf2Iv11chat_serverNS_10shared_ptrI12chat_sessionEERKNS_6system10error_codeEEENSB_5list3INSB_5valueIPSF_EENSP_ISI_EEPFNS_3argILi1EEEvEEEEEE18do_completion_implEPNS1_19win_iocp_io_service9operationEmj[boost::asio::detail::win_iocp_socket_service<boost::asio::ip::tcp>::accept_operation<boost::asio::basic_socket<boost::asio::ip::tcp, boost::asio::stream_socket_service<boost::asio::ip::tcp> >, boost::_bi::bind_t<void, boost::_mfi::mf2<void, chat_server, boost::shared_ptr<chat_session>, boost::system::error_code const&>, boost::_bi::list3<boost::_bi::value<chat_server*>, boost::_bi::value<boost::shared_ptr<chat_session> >, boost::arg<1> (*)()> > >::do_completion_impl(boost::asio::detail::win_iocp_io_service::operation*, unsigned long, unsigned int)]+0x2b9):chat_server.cpp: undefined reference to `WSAGetLastError@0'
C:\DOCUME~1\User\LOCALS~1\Temp/ccQbidaa.o(.text$_ZN5boost4asio6detail23win_iocp_socket_serviceINS0_2ip3tcpEE16accept_operationINS0_12basic_socketIS4_NS0_21stream_socket_serviceIS4_EEEENS_3_bi6bind_tIvNS_4_mfi3mf2Iv11chat_serverNS_10shared_ptrI12chat_sessionEERKNS_6system10error_codeEEENSB_5list3INSB_5valueIPSF_EENSP_ISI_EEPFNS_3argILi1EEEvEEEEEE18do_completion_implEPNS1_19win_iocp_io_service9operationEmj[boost::asio::detail::win_iocp_socket_service<boost::asio::ip::tcp>::accept_operation<boost::asio::basic_socket<boost::asio::ip::tcp, boost::asio::stream_socket_service<boost::asio::ip::tcp> >, boost::_bi::bind_t<void, boost::_mfi::mf2<void, chat_server, boost::shared_ptr<chat_session>, boost::system::error_code const&>, boost::_bi::list3<boost::_bi::value<chat_server*>, boost::_bi::value<boost::shared_ptr<chat_session> >, boost::arg<1> (*)()> > >::do_completion_impl(boost::asio::detail::win_iocp_io_service::operation*, unsigned long, unsigned int)]+0x434):chat_server.cpp: undefined reference to `GetAcceptExSockaddrs@32' C:\DOCUME~1\User\LOCALS~1\Temp/ccQbidaa.o(.text$_ZN5boost4asio6detail23win_iocp_socket_serviceINS0_2ip3tcpEE10async_sendINS1_17consuming_buffersINS0_12const_bufferENS0_17mutable_buffers_1EEENS1_13write_handlerINS0_19basic_stream_socketIS4_NS0_21stream_socket_serviceIS4_EEEES9_NS1_14transfer_all_tENS_3_bi6bind_tIvNS_4_mfi3mf1Iv12chat_sessionRKNS_6system10error_codeEEENSH_5list2INSH_5valueINS_10shared_ptrISL_EEEEPFNS_3argILi1EEEvEEEEEEEEEvRNS5_19implementation_typeERKT_iT0_[void boost::asio::detail::win_iocp_socket_service<boost::asio::ip::tcp>::async_send<boost::asio::detail::consuming_buffers<boost::asio::const_buffer, boost::asio::mutable_buffers_1>, boost::asio::detail::write_handler<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::stream_socket_service<boost::asio::ip::tcp> >, boost::asio::mutable_buffers_1, boost::asio::detail::transfer_all_t, boost::_bi::bind_t<void, boost::_mfi::mf1<void, chat_session, boost::system::error_code const&>, boost::_bi::list2<boost::_bi::value<boost::shared_ptr<chat_session> >, boost::arg<1> (*)()> > > >(boost::asio::detail::win_iocp_socket_service<boost::asio::ip::tcp>::implementation_type&, boost::asio::detail::consuming_buffers<boost::asio::const_buffer, boost::asio::mutable_buffers_1> const&, int, boost::asio::detail::write_handler<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::stream_socket_service<boost::asio::ip::tcp> >, boost::asio::mutable_buffers_1, boost::asio::detail::transfer_all_t, boost::_bi::bind_t<void, boost::_mfi::mf1<void, chat_session, boost::system::error_code const&>, boost::_bi::list2<boost::_bi::value<boost::shared_ptr<chat_session> >, boost::arg<1> (*)()> > >)]+0x4b4):chat_server.cpp: undefined reference to `WSASend@28' C:\DOCUME~1\User\LOCALS~1\Temp/ccQbidaa.o(.text$_ZN5boost4asio6detail23win_iocp_socket_serviceINS0_2ip3tcpEE10async_sendINS1_17consuming_buffersINS0_12const_bufferENS0_17mutable_buffers_1EEENS1_13write_handlerINS0_19basic_stream_socketIS4_NS0_21stream_socket_serviceIS4_EEEES9_NS1_14transfer_all_tENS_3_bi6bind_tIvNS_4_mfi3mf1Iv12chat_sessionRKNS_6system10error_codeEEENSH_5list2INSH_5valueINS_10shared_ptrISL_EEEEPFNS_3argILi1EEEvEEEEEEEEEvRNS5_19implementation_typeERKT_iT0_[void boost::asio::detail::win_iocp_socket_service<boost::asio::ip::tcp>::async_send<boost::asio::detail::consuming_buffers<boost::asio::const_buffer, boost::asio::mutable_buffers_1>, boost::asio::detail::write_handler<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::stream_socket_service<boost::asio::ip::tcp> >, boost::asio::mutable_buffers_1, boost::asio::detail::transfer_all_t, boost::_bi::bind_t<void, boost::_mfi::mf1<void, chat_session, boost::system::error_code const&>, boost::_bi::list2<boost::_bi::value<boost::shared_ptr<chat_session> >, boost::arg<1> (*)()> > > >(boost::asio::detail::win_iocp_socket_service<boost::asio::ip::tcp>::implementation_type&, boost::asio::detail::consuming_buffers<boost::asio::const_buffer, boost::asio::mutable_buffers_1> const&, int, boost::asio::detail::write_handler<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::stream_socket_service<boost::asio::ip::tcp> >, boost::asio::mutable_buffers_1, boost::asio::detail::transfer_all_t, boost::_bi::bind_t<void, boost::_mfi::mf1<void, chat_session, boost::system::error_code const&>, boost::_bi::list2<boost::_bi::value<boost::shared_ptr<chat_session> >, boost::arg<1> (*)()> > >)]+0x4c2):chat_server.cpp: undefined reference to `WSAGetLastError@0'
collect2: ld returned 1 exit status
|
может кто-нибудь подсказать в чем проблема? какую еще либу нужно подключить при линковке? Это сообщение отредактировал(а) anatox91 - 12.5.2009, 22:47
--------------------
The code is the design © Sony VAIO VGN-FW480J 
|