[Libav-user] Libavformat libavcodec problems while compiling

Luke Clemens lclemens at gmail.com
Wed Oct 19 20:37:36 CEST 2011


Also since you're using gcc, i think you need to enclose your #includes
within and extern "C"  { }

On Mon, Oct 17, 2011 at 6:47 PM, Alex Cohn <alexcohn at netvision.net.il>wrote:

> On Oct 17, 2011 8:39 PM, "Fernando Vasconcellos" <fernandovsv at gmail.com>
> wrote:
> >
> > Hi,
> >
> > Im trying to manipulate libavformat and libavcodec for some streaming
> project that im participating but some problems are on my way.
> >
> > Here is a simple code that i cant compile.
> >
> > #include <libavcodec/avcodec.h>
> > #include <libavformat/avformat.h>
> >
> >
> > #include <stdio.h>
> > #include <stdlib.h>
> > #include <stdbool.h>
> >
> > int main (int argc, const char * argv[]) {
> > av_register_all();
> >
> > return 0;
> > }
> >
> > compiled with: gcc -o tutorial01 teste.c -lavformat -lavcodec -lz -lm
>
> You should add -lavutil and maybe other libraries too to your gcc command
> line.
>
> Good luck,
> Alex
>
> > with this ffmpeg version:
> > ffmpeg version N-33135-g3b0e242, Copyright (c) 2000-2011 the FFmpeg
> developers
> >   built on Oct  3 2011 14:26:14 with gcc 4.5.2
> >   configuration: --enable-gpl --enable-libfaac --enable-libmp3lame
> --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora
> --enable-libvorbis --enable-libx264 --enable-libxvid --enable-nonfree
> --enable-postproc --enable-version3 --enable-x11grab
> >   libavutil    51. 18. 0 / 51. 18. 0
> >   libavcodec   53. 19. 0 / 53. 19. 0
> >   libavformat  53. 13. 0 / 53. 13. 0
> >   libavdevice  53.  4. 0 / 53.  4. 0
> >   libavfilter   2. 43. 6 /  2. 43. 6
> >   libswscale    2.  1. 0 /  2.  1. 0
> >   libpostproc  51.  2. 0 / 51.  2. 0
> >
> >
> > Erros returned:
> > /usr/local/lib/libavcodec.a(mjpeg2jpeg_bsf.o): In function
> `mjpeg2jpeg_filter':
> > /home/fernandovsv/ffmpeg/libavcodec/mjpeg2jpeg_bsf.c:98: undefined
> reference to `av_malloc'
> > /home/fernandovsv/ffmpeg/libavcodec/mjpeg2jpeg_bsf.c:88: undefined
> reference to `av_log'
>
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
>
>


-- 
-
-
-
-
Luke Clemens
http://clemens.bytehammer.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20111019/8d58860c/attachment.html>


More information about the Libav-user mailing list