I am trying to use some functions from ffmpeg and am in persistent linker errors. Here is what I did:
This is my main.cpp:
#include "avformat.h" int main() { av_register_all(); }
This fails:
error LNK2019: unresolved external symbol "void __cdecl av_register_all (void)" (? av_register_all @@ YAXXZ) referenced in the _main function
How can I fix this error?
When you use C ++, you need to surround your ffmpeg #include statements with extern "C" as follows:
#include
extern "C"
extern "C" { #include "avformat.h" }