gpt4 book ai didi

c++ - ffmpeg 的 Windows 库不链接(visual studio)?

转载 作者:可可西里 更新时间:2023-11-01 14:04:17 29 4
gpt4 key购买 nike

所以,我正在尝试让我正在编写的项目链接到 ffmpeg 库,但我不断收到链接器错误:

1>GLViewLASReader.obj : error LNK2001: unresolved external symbol "struct AVCodec * __cdecl avcodec_find_encoder(enum AVCodecID)" (?avcodec_find_encoder@@YAPEAUAVCodec@@W4AVCodecID@@@Z)
1>GLViewLASReader.obj : error LNK2001: unresolved external symbol "int __cdecl av_dict_set(struct AVDictionary * *,char const *,char const *,int)" (?av_dict_set@@YAHPEAPEAUAVDictionary@@PEBD1H@Z)
1>GLViewLASReader.obj : error LNK2001: unresolved external symbol "int __cdecl avcodec_encode_video(struct AVCodecContext *,unsigned char *,int,struct AVFrame const *)" (?avcodec_encode_video@@YAHPEAUAVCodecContext@@PEAEHPEBUAVFrame@@@Z)
1>GLViewLASReader.obj : error LNK2001: unresolved external symbol "struct AVCodecContext * __cdecl avcodec_alloc_context3(struct AVCodec const *)" (?avcodec_alloc_context3@@YAPEAUAVCodecContext@@PEBUAVCodec@@@Z)
1>GLViewLASReader.obj : error LNK2001: unresolved external symbol "struct AVFrame * __cdecl avcodec_alloc_frame(void)" (?avcodec_alloc_frame@@YAPEAUAVFrame@@XZ)
1>GLViewLASReader.obj : error LNK2001: unresolved external symbol "void __cdecl av_free(void *)" (?av_free@@YAXPEAX@Z)
1>GLViewLASReader.obj : error LNK2001: unresolved external symbol "int __cdecl avcodec_open2(struct AVCodecContext *,struct AVCodec const *,struct AVDictionary * *)" (?avcodec_open2@@YAHPEAUAVCodecContext@@PEBUAVCodec@@PEAPEAUAVDictionary@@@Z)
1>GLViewLASReader.obj : error LNK2001: unresolved external symbol "int __cdecl avcodec_close(struct AVCodecContext *)" (?avcodec_close@@YAHPEAUAVCodecContext@@@Z)
1>C:\STEAMiE\usr\modules\LASReader\win32\Release\LASReader.exe : fatal error LNK1120: 8 unresolved externals

我从以下位置下载了开发包:

http://ffmpeg.zeranoe.com/builds/

但是当我像往常一样链接库时,我得到了链接器错误。这个包与我尝试使用的所有其他库有什么不同,我只需要 .h/.libs 吗?为什么一定要这样?

最佳答案

由于您的链接器错误消息中的函数标识符没有 _ 前缀,我怀疑您忘记将您使用的 ffmpeg 包含文件放入“extern "C"{ }”部分。

关于c++ - ffmpeg 的 Windows 库不链接(visual studio)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19497793/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com