Reputation: 22123
I'm trying to use some functions from ffmpeg and am running into resilient linker errors. Here's what I did:
This is my main.cpp:
#include "avformat.h"
int main()
{
av_register_all();
}
This fails with:
error LNK2019: unresolved external symbol "void __cdecl av_register_all(void)" (?av_register_all@@YAXXZ) referenced in function _main
How can I fix this error?
Upvotes: 9
Views: 8079
Reputation: 26279
As you're using C++, you need to surround your ffmpeg #include
statements with extern "C"
like this :
extern "C"
{
#include "avformat.h"
}
Upvotes: 39