I’m working on C++ project on Windows which involve FFmpeg library.
The problem is that I can’t include ffmpeg library to my project. I can’t even run any of ffmpeg tutorials or examples. I’m always getting errors like the following:
tutorial01.c:22:28: ffmpeg/avcodec.h: No such file or directory
tutorial01.c:23:29: ffmpeg/avformat.h: No such file or directory
and lots of errors like:
tutorial01.c:33: error: `iFrame' undeclared (first use in this function)
I found the tutorial with this instructions:
//gcc -o tutorial01 tutorial01.c -lavformat -lavcodec -lz
//to build (assuming libavformat and libavcodec are correctly installed
//your system).
After further searching I found out that I should get a static build library version from here:
http://ffmpeg.zeranoe.com/builds/
Then I installed this library following these instructions:
- Get the latest build from the arrozcru autobuilds page
- Unzip the folder into C:/Program Files/ffmpeg
- Add C:/Program Files/ffmpeg/bin to your system’s PATH environment variable
But I still have compilation errors of the same kind.
So, it seems it was not correct installation.
What should I do to connect ffmpeg library to my project on Windows?
So to summarize the answer, you needed to add ffmpeg’s include and lib directories to the directory paths of gcc.