编译出现这种原因是由于:dll中封装的是.c 文件,函数接口不对,所以必须:
extern "C"
{
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavutil/avutil.h>
#include <libswscale/swscale.h>
}
本文探讨了在使用DLL封装的.c文件时遇到的问题,特别是当DLL中的函数接口与预期不符时导致的编译错误。文章提供了一个解决方法,即通过使用extern C来确保正确地链接到C风格的函数。
编译出现这种原因是由于:dll中封装的是.c 文件,函数接口不对,所以必须:
extern "C"
{
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavutil/avutil.h>
#include <libswscale/swscale.h>
}

被折叠的 条评论
为什么被折叠?