Changes between Initial Version and Version 1 of Including FFmpeg headers in a C++ application


Ignore:
Timestamp:
Sep 26, 2012, 2:41:30 PM (7 years ago)
Author:
saste
Comment:

create first version of page

Legend:

Unmodified
Added
Removed
Modified
  • Including FFmpeg headers in a C++ application

    v1 v1  
     1FFmpeg is written in C99, thus some features may not be compilable or usable in C++.
     2
     3Anyway, for most purposes, including FFmpeg headers in a C++ application should be rather straightforward.
     4
     5First, 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{{{
     7extern "C" {
     8#include <libavutil/imgutils.h>
     9#include <libavcodec/avcodec.h>
     10#include <libswscale/swscale.h>
     11}
     12}}}
     13
     14Second, 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