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?
As you're using C++, you need to surround your ffmpeg #include
statements with extern "C"
like this :
extern "C"
{
#include "avformat.h"
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With