| 1 | FFmpeg is written in C99, thus some features may not be compilable or usable in C++. |
| 2 | |
| 3 | Anyway, for most purposes, including FFmpeg headers in a C++ application should be rather straightforward. |
| 4 | |
| 5 | First, to include the FFmpeg headers within your C++ application you need to explicitly state that you are including C code. You can do this by encompassing your FFmpeg includes using extern "C", like in: |
| 6 | {{{ |
| 7 | extern "C" { |
| 8 | #include <libavutil/imgutils.h> |
| 9 | #include <libavcodec/avcodec.h> |
| 10 | #include <libswscale/swscale.h> |
| 11 | } |
| 12 | }}} |
| 13 | |
| 14 | Second, you may need to append {{{-D__STDC_CONSTANT_MACROS}}} to your CXXFLAGS flags, if the compiler complains about ’UINT64_C’ was not declared in this scope. |
| 15 | |