avformat.lib和VS2013

时间:2016-02-26 20:26:09

标签: visual-studio-2013 ffmpeg

我正在使用--toolchain = msvc

静态编译FFmpeg VS2013更新5

如果我链接到avformat.lib,我会收到一堆LNK2019错误 我可以将make调用链接到其他库(avcodec,swscale,avutil)。

查看错误,它似乎反对所有网络.o(tls_schannel.o,networking.o,tcp.o等等)

这是输出

error LNK2019: unresolved external symbol _QueryContextAttributesA@12 referenced in function _tls_write avformat.lib(tls_schannel.o)
error LNK2019: unresolved external symbol _InitializeSecurityContextA@48 referenced in function _tls_client_handshake   avformat.lib(tls_schannel.o)
error LNK2019: unresolved external symbol _FreeContextBuffer@4 referenced in function _tls_client_handshake avformat.lib(tls_schannel.o)
error LNK2019: unresolved external symbol _EncryptMessage@16 referenced in function _tls_write  avformat.lib(tls_schannel.o)
error LNK2019: unresolved external symbol _DecryptMessage@16 referenced in function _tls_read   avformat.lib(tls_schannel.o)
error LNK2019: unresolved external symbol _AcquireCredentialsHandleA@36 referenced in function _tls_open    avformat.lib(tls_schannel.o)
error LNK2019: unresolved external symbol __imp__WSAStartup@8 referenced in function _ff_network_init   avformat.lib(network.o)
error LNK2019: unresolved external symbol __imp__WSAGetLastError@0 referenced in function _ff_neterrno  avformat.lib(network.o)
error LNK2019: unresolved external symbol __imp__WSACleanup@0 referenced in function _ff_network_close  avformat.lib(network.o)
error LNK2019: unresolved external symbol __imp__socket@12 referenced in function _ff_socket    avformat.lib(network.o)
error LNK2019: unresolved external symbol __imp__shutdown@8 referenced in function _tcp_shutdown    avformat.lib(tcp.o)
error LNK2019: unresolved external symbol __imp__setsockopt@20 referenced in function _tcp_open avformat.lib(tcp.o)
error LNK2019: unresolved external symbol __imp__sendto@24 referenced in function _rtp_write    avformat.lib(rtpproto.o)
error LNK2019: unresolved external symbol __imp__send@16 referenced in function _tcp_write  avformat.lib(tcp.o)
error LNK2019: unresolved external symbol __imp__select@20 referenced in function _ff_poll  avformat.lib(os_support.o)
error LNK2019: unresolved external symbol __imp__recvfrom@24 referenced in function _rtp_read   avformat.lib(rtpproto.o)
error LNK2019: unresolved external symbol __imp__recv@16 referenced in function _tcp_read   avformat.lib(tcp.o)
error LNK2019: unresolved external symbol __imp__ntohs@4 referenced in function _get_port   avformat.lib(rtpproto.o)
error LNK2019: unresolved external symbol __imp__ntohl@4 referenced in function _ff_is_multicast_address    avformat.lib(network.o)
error LNK2019: unresolved external symbol __imp__listen@8 referenced in function _ff_listen avformat.lib(network.o)
error LNK2019: unresolved external symbol __imp__ioctlsocket@12 referenced in function _ff_socket_nonblock  avformat.lib(os_support.o)
error LNK2019: unresolved external symbol __imp__htons@4 referenced in function _set_port   avformat.lib(rtpproto.o)
error LNK2019: unresolved external symbol __imp__htonl@4 referenced in function _ff_inet_aton   avformat.lib(os_support.o)
error LNK2019: unresolved external symbol __imp__getsockopt@20 referenced in function _udp_open avformat.lib(udp.o)
error LNK2019: unresolved external symbol __imp__getsockname@12 referenced in function _rtp_read_header avformat.lib(rtsp.o)
error LNK2019: unresolved external symbol __imp__getpeername@12 referenced in function _ff_rtsp_connect avformat.lib(rtsp.o)
error LNK2019: unresolved external symbol __imp__getnameinfo@28 referenced in function _sdp_read_header avformat.lib(rtsp.o)
error LNK2019: unresolved external symbol __imp__gethostname@8 referenced in function _ff_rtp_parse_open    avformat.lib(rtpdec.o)
error LNK2019: unresolved external symbol __imp__FreeCredentialsHandle@4 referenced in function _tls_close  avformat.lib(tls_schannel.o)
error LNK2019: unresolved external symbol __imp__DeleteSecurityContext@4 referenced in function _tls_close  avformat.lib(tls_schannel.o)
error LNK2019: unresolved external symbol __imp__connect@12 referenced in function _udp_open    avformat.lib(udp.o)
error LNK2019: unresolved external symbol __imp__closesocket@4 referenced in function _tcp_close    avformat.lib(tcp.o)
error LNK2019: unresolved external symbol __imp__bind@12 referenced in function _udp_open   avformat.lib(udp.o)
error LNK2019: unresolved external symbol __imp__ApplyControlToken@8 referenced in function _tls_shutdown_client    avformat.lib(tls_schannel.o)
error LNK2019: unresolved external symbol __imp__accept@12 referenced in function _ff_accept    avformat.lib(network.o)
error LNK2019: unresolved external symbol ___WSAFDIsSet@8 referenced in function _ff_poll   avformat.lib(os_support.o)
error LNK2001: unresolved external symbol __imp__setsockopt@20  avformat.lib(udp.o)
error LNK2001: unresolved external symbol __imp__setsockopt@20  avformat.lib(network.o)
error LNK2001: unresolved external symbol __imp__sendto@24  avformat.lib(udp.o)
error LNK2001: unresolved external symbol __imp__send@16    avformat.lib(udp.o)
error LNK2001: unresolved external symbol __imp__recv@16    avformat.lib(udp.o)
error LNK2001: unresolved external symbol __imp__getsockopt@20  avformat.lib(network.o)
error LNK2001: unresolved external symbol __imp__getsockname@12 avformat.lib(sapenc.o)
error LNK2001: unresolved external symbol __imp__getsockname@12 avformat.lib(udp.o)
error LNK2001: unresolved external symbol __imp__getnameinfo@28 avformat.lib(udp.o)
error LNK2001: unresolved external symbol __imp__getnameinfo@28 avformat.lib(sdp.o)
error LNK2001: unresolved external symbol __imp__getaddrinfo@16 avformat.lib(udp.o)
error LNK2001: unresolved external symbol __imp__getaddrinfo@16 avformat.lib(url.o)
error LNK2001: unresolved external symbol __imp__getaddrinfo@16 avformat.lib(sdp.o)
error LNK2001: unresolved external symbol __imp__getaddrinfo@16 avformat.lib(tls.o)
error LNK2001: unresolved external symbol __imp__getaddrinfo@16 avformat.lib(rtsp.o)
error LNK2001: unresolved external symbol __imp__getaddrinfo@16 avformat.lib(sapenc.o)
error LNK2001: unresolved external symbol __imp__getaddrinfo@16 avformat.lib(rtpproto.o)
error LNK2001: unresolved external symbol __imp__getaddrinfo@16 avformat.lib(tcp.o)
error LNK2001: unresolved external symbol __imp__freeaddrinfo@4 avformat.lib(udp.o)
error LNK2001: unresolved external symbol __imp__freeaddrinfo@4 avformat.lib(url.o)
error LNK2001: unresolved external symbol __imp__freeaddrinfo@4 avformat.lib(sdp.o)
error LNK2001: unresolved external symbol __imp__freeaddrinfo@4 avformat.lib(tls.o)
error LNK2001: unresolved external symbol __imp__freeaddrinfo@4 avformat.lib(rtsp.o)
error LNK2001: unresolved external symbol __imp__freeaddrinfo@4 avformat.lib(sapenc.o)
error LNK2001: unresolved external symbol __imp__freeaddrinfo@4 avformat.lib(rtpproto.o)
error LNK2001: unresolved external symbol __imp__freeaddrinfo@4 avformat.lib(tcp.o)
error LNK2001: unresolved external symbol __imp__connect@12 avformat.lib(network.o)
error LNK2001: unresolved external symbol __imp__closesocket@4  avformat.lib(udp.o)
error LNK2001: unresolved external symbol __imp__closesocket@4  avformat.lib(network.o)
error LNK2001: unresolved external symbol __imp__bind@12    avformat.lib(network.o)

1 个答案:

答案 0 :(得分:1)

链接程序时由于缺少Windows套接字库而导致这种情况。 如果你不想从ffmpeg获得任何网络功能,只需在构建ffmpeg时将此开关添加到configure命令:

--disable-network 

或者如果您希望将网络添加Ws2_32.lib添加到程序中链接器选项中的其他依赖项。