我正在尝试使用ffmpeg中的一些函数,并且遇到了弹性链接器错误.这是我做的:
这是我的main.cpp:
#include "avformat.h"
int main()
{
av_register_all();
}
Run Code Online (Sandbox Code Playgroud)
这失败了:
错误LNK2019:函数_main中引用的未解析的外部符号"void __cdecl av_register_all(void)"(?av_register_all @@ YAXXZ)
我该如何解决这个错误?
Rog*_*and 28
当你使用C++时,你需要#include
用extern "C"
这样的方式包围你的ffmpeg 语句:
extern "C"
{
#include "avformat.h"
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
5737 次 |
最近记录: |