1. Introduction à l'environnement
Version IDE de Visual Studio: VS2017
Version QT: QT5.12.6
Environnement problématique: le programme QT a été développé sous Visual Studio 2017, et la bibliothèque ffmpeg a été référencée pour réaliser le développement du lecteur vidéo.
erreur LNK2019:
erreur de symbole externe non résolue LNK2001: symbole externe non résolu
1>CClipVideo.obj : error LNK2019: 无法解析的外部符号 _avformat_alloc_output_context2,该符号在函数 "protected: int __thiscall CClipVideo::ClipVideo(void)" (?ClipVideo@CClipVideo@@IAEHXZ) 中被引用
1>VideoEncode.obj : error LNK2001: 无法解析的外部符号 _avformat_alloc_output_context2
1>CClipVideo.obj : error LNK2019: 无法解析的外部符号 _avformat_open_input,该符号在函数 "protected: int __thiscall CClipVideo::ClipVideo(void)" (?ClipVideo@CClipVideo@@IAEHXZ) 中被引用
1>CDecodeAudio.obj : error LNK2001: 无法解析的外部符号 _avformat_open_input
1>KFileDecoders.obj : error LNK2001: 无法解析的外部符号 _avformat_open_input
1>VideoEncode.obj : error LNK2001: 无法解析的外部符号 _avformat_open_input
1>CClipVideo.obj : error LNK2019: 无法解析的外部符号 _av_read_frame,该符号在函数 "protected: int __thiscall CClipVideo::ClipVideo(void)" (?ClipVideo@CClipVideo@@IAEHXZ) 中被引用
1>CDecodeAudio.obj : error LNK2001: 无法解析的外部符号 _av_read_frame
1>KFileDecoders.obj : error LNK2001: 无法解析的外部符号 _av_read_frame
1>VideoEncode.obj : error LNK2001: 无法解析的外部符号 _av_read_frame
1>CClipVideo.obj : error LNK2019: 无法解析的外部符号 _av_seek_frame,该符号在函数 "protected: int __thiscall CClipVideo::ClipVideo(void)" (?ClipVideo@CClipVideo@@IAEHXZ) 中被引用
1>KFileDecoders.obj : error LNK2001: 无法解析的外部符号 _av_seek_frame
1>CClipVideo.obj : error LNK2019: 无法解析的外部符号 _avformat_close_input,该符号在函数 "protected: int __thiscall CClipVideo::ClipVideo(void)" (?ClipVideo@CClipVideo@@IAEHXZ) 中被引用
1>CDecodeAudio.obj : error LNK2001: 无法解析的外部符号 _avformat_close_input
1>KFileDecoders.obj : error LNK2001: 无法解析的外部符号 _avformat_close_input
1>VideoEncode.obj : error LNK2001: 无法解析的外部符号 _avformat_close_input
1>CClipVideo.obj : error LNK2019: 无法解析的外部符号 _avformat_write_header,该符号在函数 "protected: int __thiscall CClipVideo::ClipVideo(void)" (?ClipVideo@CClipVideo@@IAEHXZ) 中被引用
1>VideoEncode.obj : error LNK2001: 无法解析的外部符号 _avformat_write_header
1>CClipVideo.obj : error LNK2019: 无法解析的外部符号 _av_interleaved_write_frame,该符号在函数 "protected: int __thiscall CClipVideo::ClipVideo(void)" (?ClipVideo@CClipVideo@@IAEHXZ) 中被引用
1>VideoEncode.obj : error LNK2001: 无法解析的外部符号 _av_interleaved_write_frame
1>CClipVideo.obj : error LNK2019: 无法解析的外部符号 _av_write_trailer,该符号在函数 "protected: int __thiscall CClipVideo::ClipVideo(void)" (?ClipVideo@CClipVideo@@IAEHXZ) 中被引用
1>VideoEncode.obj : error LNK2001: 无法解析的外部符号 _av_write_trailer
Deuxièmement, résolvez le problème
En cas de problème, la fonction associée de la bibliothèque externe est généralement citée dans le projet et le chemin de la bibliothèque n'est pas spécifié dans le lien ou le fichier .cpp qui définit la fonction n'est pas ajouté au projet.
Si c'est parce que la bibliothèque externe est référencée et que les fonctions de la bibliothèque externe sont utilisées et que le chemin du lien n'est pas ajouté, ajoutez la bibliothèque utilisée aux dépendances supplémentaires conformément à la figure suivante .