C++代码编译遇到 无法解析的外部符号 一种情况记录

放弃幻想 准备战斗 / 2023-05-25 / 原文

因为调用了C代码,加载C代码头文件 ***.h时记得加 extern "C"

extern "C"
{
#include "libavcodec/avcodec.h"
#include "libavformat/avformat.h"
}