[Libav-user] Compile with g++

Andy Shaules bowljoman at gmail.com
Fri Oct 11 02:00:55 CEST 2013

On 10/10/2013 4:34 PM, Bruce Wheaton wrote:
> On Oct 9, 2013, at 7:29 AM, James Board <jpboard2 at yahoo.com 
> <mailto:jpboard2 at yahoo.com>> wrote:
>> Really?  The title of the mailing list is Libav-user at ffmpeg.org 
>> <mailto:Libav-user at ffmpeg.org>.
>> I'm asking whether libav can be used in C++ programs, if anyone
>> uses libav in C++ programs, and what I need to do in order to
>> use libav in C++ programs.  How can that be inappropriate?
> That is confusing. The libraries that make up ffmpeg include 
> libavcodec, libavformat etc. Hence the list - it's for users of the 
> libraries, not the ffmpeg binary. To confuse matters, there was a 
> fork, and they called that project LibAV.
> So - you're using libavformat, libavcodec etc. But - are you using 
> source code obtained from the ffmpeg project, or the libav project? 
> This list is specific to the ffmpeg project.
>> Anyway, don't bother.  I give up.  You win.
> LOL. I feel your pain. Sadly, a certain amount of chaff comes with 
> using FOSS systems (nothing personal to the chaff providers on this 
> thread). Lots of personalities. The upside outweighs the cost in 
> humility that is required.
> Anyway... LibAV, I have no idea. FFmpeg, yes, you can compile and use 
> it from C++ with very little problems - just the packaging around the 
> headers so the compiler knows they are C, not C++.
>> When I compile demuxing.c with g++ it gives me the same errors as 
>> when I add libav calls to my C++ app and then try to compile that 
>> with g++.  So, if we can figure out why demuxing.c won't compile with 
>> g++, then we will probably figure out why my C++ app won't compile 
>> with g++.
> This: just wrong. The fact that one C based example does or does not 
> compile offers no evidence as to what your actual problem is.
> Bruce
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user

I did just fine with my c++ app and even with a c++ dll that exposed a 
simplified set of av_codec compression functions.

As someone mentioned earlier, it was as easy as:

extern "C" {
         #include <avcodec.h>
         #include <avformat.h>
         #include <swscale.h>
         #include <imgutils.h>

Have Fun!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20131010/4ed16295/attachment.html>

More information about the Libav-user mailing list