首页 > 解决方案 > Visual Studio 中的 ffmpeg 静态链接

问题描述

我已经在 Windows 上构建了 ffmpeg 静态库。似乎一切都顺利完成了。构建的结果是以下文件:

libavcodec.a
libavdevice.a
libavfilter.a
libavformat.a
libavutil.a
libswscale.a

我试图在我的 C++ libray 项目的 Linker->Input 中指定上述文件,但链接失败。以下是构建输出:

1>libavutil.a(samplefmt.o) : error LNK2001: unresolved external symbol ___stdio_common_vsprintf
1>libavutil.a(error.o) : error LNK2001: unresolved external symbol ___stdio_common_vsprintf
1>libavutil.a(log.o) : error LNK2001: unresolved external symbol ___stdio_common_vsprintf
1>libavutil.a(utils.o) : error LNK2001: unresolved external symbol ___stdio_common_vsprintf
1>libavutil.a(avstring.o) : error LNK2001: unresolved external symbol ___stdio_common_vsprintf
1>libavutil.a(bprint.o) : error LNK2001: unresolved external symbol ___stdio_common_vsprintf
1>libavformat.a(id3v2.o) : error LNK2001: unresolved external symbol ___stdio_common_vsprintf
1>libavutil.a(opt.o) : error LNK2001: unresolved external symbol ___stdio_common_vsprintf
1>libavutil.a(dict.o) : error LNK2001: unresolved external symbol ___stdio_common_vsprintf
1>libavutil.a(pixdesc.o) : error LNK2001: unresolved external symbol ___stdio_common_vsprintf
1>libavcodec.a(ratecontrol.o) : error LNK2001: unresolved external symbol ___stdio_common_vsprintf
1>libavcodec.a(qsv.o) : error LNK2001: unresolved external symbol ___stdio_common_vsprintf
1>libavformat.a(utils.o) : error LNK2001: unresolved external symbol ___stdio_common_vsprintf
1>libavformat.a(aviobuf.o) : error LNK2001: unresolved external symbol ___stdio_common_vsprintf
1>libavcodec.a(utils.o) : error LNK2001: unresolved external symbol ___stdio_common_vsprintf
1>libavcodec.a(ffv1enc.o) : error LNK2001: unresolved external symbol ___stdio_common_vsprintf
1>libavcodec.a(libvpxenc.o) : error LNK2001: unresolved external symbol ___stdio_common_vsprintf
1>libavcodec.a(exif.o) : error LNK2001: unresolved external symbol ___stdio_common_vsprintf
1>libavcodec.a(libvpxenc.o) : error LNK2001: unresolved external symbol _vpx_img_wrap
1>libavcodec.a(libvpxenc.o) : error LNK2001: unresolved external symbol _vpx_codec_version_str
1>libavcodec.a(libvpxdec.o) : error LNK2001: unresolved external symbol _vpx_codec_version_str
1>libavcodec.a(libvpxenc.o) : error LNK2001: unresolved external symbol _vpx_codec_build_config
1>libavcodec.a(libvpxdec.o) : error LNK2001: unresolved external symbol _vpx_codec_build_config
1>libavcodec.a(libvpxenc.o) : error LNK2001: unresolved external symbol _vpx_codec_err_to_string
1>libavcodec.a(libvpxenc.o) : error LNK2001: unresolved external symbol _vpx_codec_error
1>libavcodec.a(libvpxdec.o) : error LNK2001: unresolved external symbol _vpx_codec_error
1>libavcodec.a(libvpxenc.o) : error LNK2001: unresolved external symbol _vpx_codec_error_detail
1>libavcodec.a(libvpxdec.o) : error LNK2001: unresolved external symbol _vpx_codec_error_detail
1>libavcodec.a(libvpxenc.o) : error LNK2001: unresolved external symbol _vpx_codec_destroy
1>libavcodec.a(libvpxdec.o) : error LNK2001: unresolved external symbol _vpx_codec_destroy
1>libavcodec.a(libvpxenc.o) : error LNK2001: unresolved external symbol _vpx_codec_control_
1>libavcodec.a(libvpxenc.o) : error LNK2001: unresolved external symbol _vpx_codec_enc_init_ver
1>libavcodec.a(libvpxenc.o) : error LNK2001: unresolved external symbol _vpx_codec_enc_config_default
1>libavcodec.a(libvpxenc.o) : error LNK2001: unresolved external symbol _vpx_codec_encode
1>libavcodec.a(libvpxenc.o) : error LNK2001: unresolved external symbol _vpx_codec_get_cx_data
1>libavcodec.a(libvpxenc.o) : error LNK2001: unresolved external symbol _vpx_codec_vp8_cx
1>libavcodec.a(libvpxdec.o) : error LNK2001: unresolved external symbol _vpx_codec_dec_init_ver
1>libavcodec.a(libvpxdec.o) : error LNK2001: unresolved external symbol _vpx_codec_decode
1>libavcodec.a(libvpxdec.o) : error LNK2001: unresolved external symbol _vpx_codec_get_frame
1>libavcodec.a(libvpxdec.o) : error LNK2001: unresolved external symbol _vpx_codec_vp8_dx_algo
1>libavutil.a(opt.o) : error LNK2001: unresolved external symbol ___stdio_common_vsscanf
1>libavutil.a(parseutils.o) : error LNK2001: unresolved external symbol ___stdio_common_vsscanf
1>libavcodec.a(h264_sei.o) : error LNK2001: unresolved external symbol ___stdio_common_vsscanf
1>libavcodec.a(ratecontrol.o) : error LNK2001: unresolved external symbol ___stdio_common_vsscanf
1>libavcodec.a(qsv.o) : error LNK2001: unresolved external symbol ___stdio_common_vsscanf
1>libavformat.a(id3v2.o) : error LNK2001: unresolved external symbol ___stdio_common_vsscanf
1>libavutil.a(log.o) : error LNK2001: unresolved external symbol ___acrt_iob_func
1>libavutil.a(log.o) : error LNK2001: unresolved external symbol ___stdio_common_vfprintf

这里可能缺少什么?

标签: c++ffmpegstatic-librariesstatic-linking

解决方案


推荐阅读