Skip to content

boost/asio/detail/win_fd_set_adapter.hpp:84: undefined reference to `__WSAFDIsSet@8' #597

Closed

Description

@mattrmunson

I'm having all kinds of trouble getting this to work with my setup.

g++ -I netlib/ -I boost_1_60_0/ client.cpp ^
-L boost_1_60_0/stage/lib -lboost_system-mgw48-mt-1_60 ^
-lboost_thread-mgw48-mt-1_60 -lws2_32 ^
-L netlib-build/libs/network/src -lcppnetlib-uri ^
-lcppnetlib-client-connections ^
-L C:\Users\matt\Desktop\der -llibeay32 -lssleay32 

#define _WIN32_WINNT 0x0602

#include <boost/network/protocol/http/client.hpp>
#include <iostream>

int main(int argc, char *argv[]) {
    using namespace boost::network;

    if (argc != 2) {
        std::cout << "Usage: " << argv[0] << " [url]" << std::endl;
        return 1;
    }

    http::client client;
    http::client::request request(argv[1]);
    request << header("Connection", "close");
    http::client::response response = client.get(request);
    std::cout << body(response) << std::endl;

    return 0;
}
netlib-build/libs/network/src/libcppnetlib-client-connections.a(client.cpp.obj): In function `ZNK5boost4asio6detail18win_fd_set_adapter6is_setEj':
C:/Users/matt/Desktop/boost_1_60_0/boost/asio/detail/win_fd_set_adapter.hpp:84: undefined reference to `__WSAFDIsSet@8'
netlib-build/libs/network/src/libcppnetlib-client-connections.a(client.cpp.obj): In function `ZN5boost4asio6detail10socket_ops5closeEjRhbRNS_6system10error_codeE':
C:/Users/matt/Desktop/boost_1_60_0/boost/asio/detail/impl/socket_ops.ipp:317: undefined reference to `closesocket@4'
C:/Users/matt/Desktop/boost_1_60_0/boost/asio/detail/impl/socket_ops.ipp:334: undefined reference to `ioctlsocket@12'
C:/Users/matt/Desktop/boost_1_60_0/boost/asio/detail/impl/socket_ops.ipp:349: undefined reference to `closesocket@4'
netlib-build/libs/network/src/libcppnetlib-client-connections.a(client.cpp.obj): In function `ZN5boost4asio6detail10socket_ops25set_internal_non_blockingEjRhbRNS_6system10error_codeE':
C:/Users/matt/Desktop/boost_1_60_0/boost/asio/detail/impl/socket_ops.ipp:426: undefined reference to `ioctlsocket@12'
netlib-build/libs/network/src/libcppnetlib-client-connections.a(client.cpp.obj): In function `ZN5boost4asio6detail10socket_ops8shutdownEjiRNS_6system10error_codeE':
C:/Users/matt/Desktop/boost_1_60_0/boost/asio/detail/impl/socket_ops.ipp:462: undefined reference to `shutdown@8'
netlib-build/libs/network/src/libcppnetlib-client-connections.a(client.cpp.obj): In function `ZN5boost4asio6detail10socket_ops20non_blocking_connectEjRNS_6system10error_codeE':
C:/Users/matt/Desktop/boost_1_60_0/boost/asio/detail/impl/socket_ops.ipp:576: undefined reference to `select@20'
netlib-build/libs/network/src/libcppnetlib-client-connections.a(client.cpp.obj): In function `ZN5boost4asio6detail10socket_ops6listenEjiRNS_6system10error_codeE':
C:/Users/matt/Desktop/boost_1_60_0/boost/asio/detail/impl/socket_ops.ipp:694: undefined reference to `listen@8'
netlib-build/libs/network/src/libcppnetlib-client-connections.a(client.cpp.obj): In function `ZN5boost4asio6detail10socket_ops4recvEjP7_WSABUFjiRNS_6system10error_codeE':
C:/Users/matt/Desktop/boost_1_60_0/boost/asio/detail/impl/socket_ops.ipp:771: undefined reference to `WSARecv@28'
netlib-build/libs/network/src/libcppnetlib-client-connections.a(client.cpp.obj): In function `ZN5boost4asio6detail10socket_ops4sendEjPK7_WSABUFjiRNS_6system10error_codeE':
C:/Users/matt/Desktop/boost_1_60_0/boost/asio/detail/impl/socket_ops.ipp:1154: undefined reference to `WSASend@28'
netlib-build/libs/network/src/libcppnetlib-client-connections.a(client.cpp.obj): In function `ZN5boost4asio6detail10socket_ops6socketEiiiRNS_6system10error_codeE':
C:/Users/matt/Desktop/boost_1_60_0/boost/asio/detail/impl/socket_ops.ipp:1382: undefined reference to `WSASocketW@24'
C:/Users/matt/Desktop/boost_1_60_0/boost/asio/detail/impl/socket_ops.ipp:1393: undefined reference to `setsockopt@20'
netlib-build/libs/network/src/libcppnetlib-client-connections.a(client.cpp.obj): In function `ZN5boost4asio6detail10socket_ops5ioctlEjRhiPmRNS_6system10error_codeE':
C:/Users/matt/Desktop/boost_1_60_0/boost/asio/detail/impl/socket_ops.ipp:1711: undefined reference to `ioctlsocket@12'
netlib-build/libs/network/src/libcppnetlib-client-connections.a(client.cpp.obj): In function `ZN5boost4asio6detail10socket_ops6selectEiP6fd_setS4_S4_P7timevalRNS_6system10error_codeE':
C:/Users/matt/Desktop/boost_1_60_0/boost/asio/detail/impl/socket_ops.ipp:1781: undefined reference to `select@20'
netlib-build/libs/network/src/libcppnetlib-client-connections.a(client.cpp.obj): In function `ZN5boost4asio6detail10socket_ops9inet_ptonEiPKcPvPmRNS_6system10error_codeE':
C:/Users/matt/Desktop/boost_1_60_0/boost/asio/detail/impl/socket_ops.ipp:2202: undefined reference to `WSAStringToAddressA@20'
netlib-build/libs/network/src/libcppnetlib-client-connections.a(client.cpp.obj): In function `ZN5boost4asio6detail28win_iocp_socket_service_base13start_send_opERNS2_24base_implementation_typeEP7_WSABUFjibPNS1_18win_iocp_operationE':
C:/Users/matt/Desktop/boost_1_60_0/boost/asio/detail/impl/win_iocp_socket_service_base.ipp:357: undefined reference to `WSASend@28'
netlib-build/libs/network/src/libcppnetlib-client-connections.a(client.cpp.obj): In function `ZN5boost4asio6detail28win_iocp_socket_service_base16start_receive_opERNS2_24base_implementation_typeEP7_WSABUFjibPNS1_18win_iocp_operationE':
C:/Users/matt/Desktop/boost_1_60_0/boost/asio/detail/impl/win_iocp_socket_service_base.ipp:413: undefined reference to `WSARecv@28'
netlib-build/libs/network/src/libcppnetlib-client-connections.a(client.cpp.obj): In function `ZN5boost4asio6detail28win_iocp_socket_service_base14get_connect_exERNS2_24base_implementation_typeEi':
C:/Users/matt/Desktop/boost_1_60_0/boost/asio/detail/impl/win_iocp_socket_service_base.ipp:691: undefined reference to `WSAIoctl@36'
netlib-build/libs/network/src/libcppnetlib-client-connections.a(client.cpp.obj): In function `ZN5boost4asio6detail10socket_ops11call_acceptIiEEjMNS2_6msghdrET_jP8sockaddrPj':
C:/Users/matt/Desktop/boost_1_60_0/boost/asio/detail/impl/socket_ops.ipp:96: undefined reference to `accept@12'
netlib-build/libs/network/src/libcppnetlib-client-connections.a(client.cpp.obj): In function `ZN5boost4asio6detail10socket_ops9call_bindIiEEiMNS2_6msghdrET_jPK8sockaddrj':
C:/Users/matt/Desktop/boost_1_60_0/boost/asio/detail/impl/socket_ops.ipp:276: undefined reference to `bind@12'
netlib-build/libs/network/src/libcppnetlib-client-connections.a(client.cpp.obj): In function `ZN5boost4asio6detail10socket_ops12call_connectIiEEiMNS2_6msghdrET_jPK8sockaddrj':
C:/Users/matt/Desktop/boost_1_60_0/boost/asio/detail/impl/socket_ops.ipp:472: undefined reference to `connect@12'
netlib-build/libs/network/src/libcppnetlib-client-connections.a(client.cpp.obj): In function `ZN5boost4asio6detail10socket_ops15call_setsockoptIiEEiMNS2_6msghdrET_jiiPKvj':
C:/Users/matt/Desktop/boost_1_60_0/boost/asio/detail/impl/socket_ops.ipp:1428: undefined reference to `setsockopt@20'
netlib-build/libs/network/src/libcppnetlib-client-connections.a(client.cpp.obj): In function `ZN5boost4asio6detail10socket_ops15call_getsockoptIiEEiMNS2_6msghdrET_jiiPvPj':
C:/Users/matt/Desktop/boost_1_60_0/boost/asio/detail/impl/socket_ops.ipp:1514: undefined reference to `getsockopt@20'
netlib-build/libs/network/src/libcppnetlib-client-connections.a(client.cpp.obj): In function `ZN5boost4asio6detail10socket_ops16call_getsocknameIiEEiMNS2_6msghdrET_jP8sockaddrPj':
C:/Users/matt/Desktop/boost_1_60_0/boost/asio/detail/impl/socket_ops.ipp:1678: undefined reference to `getsockname@12'
collect2.exe: error: ld returned 1 exit status

Activity

  1. deanberris commented on Feb 8, 2016

    @deanberris
    Member

    This looks like you're missing a library. I don't use Windows nor MinGW so I don't think I can help much here. Can you look up the right library to depend on that provides these symbols for you?

  2. mattrmunson commented on Feb 8, 2016

    @mattrmunson
    Author

    They should be provided in -lws2_32. I also tried adding -lwsock32 and -lmswsock.

  3. self-assigned this
    on Oct 14, 2016
  4. added this to the 0.13 milestone on Oct 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions