[Libav-user] Error while linking

gaurav mishra gauravmishra.itbhu at gmail.com
Fri Sep 18 17:29:27 CEST 2015


On Fri, Sep 18, 2015 at 8:30 PM, Paul B Mahol <onemda at gmail.com> wrote:

> On 9/18/15, gaurav mishra <gauravmishra.itbhu at gmail.com> wrote:
> > Hi,
> > I have written a app using ffmpeg's library and am able to compile and
> run
> > it on my mac (slighly older version of ffmpeg installed). But when i am
> > trying to build the code on ubuntu machine i am getting some errors
> > few of them being
> >
> > /home/ubuntu/ffmpeg_sources/ffmpeg/libavformat/rtmpproto.c:1087:
> undefined
> > reference to `inflate'
> >
> > /home/ubuntu/ffmpeg_sources/ffmpeg/libavformat/rtmpproto.c:1105:
> undefined
> > reference to `inflateEnd'
> >
> > /home/ubuntu/ffmpeg_sources/ffmpeg/libavformat/rtmpproto.c:1105:
> undefined
> > reference to `inflateEnd'
> >
> > /usr/local/lib/libavformat.a(swfdec.o): In function `swf_read_packet':
> >
> > /home/ubuntu/ffmpeg_sources/ffmpeg/libavformat/swfdec.c:358: undefined
> > reference to `uncompress'
> >
> > /usr/local/lib/libavformat.a(swfdec.o): In function `swf_read_header':
> >
> > /home/ubuntu/ffmpeg_sources/ffmpeg/libavformat/swfdec.c:147: undefined
> > reference to `inflateInit_'
> >
> > /usr/local/lib/libavformat.a(swfdec.o): In function `zlib_refill':
> >
> > /home/ubuntu/ffmpeg_sources/ffmpeg/libavformat/swfdec.c:115: undefined
> > reference to `inflate'
> >
> > /usr/local/lib/libavformat.a(swfdec.o): In function `swf_read_close':
> >
> > /home/ubuntu/ffmpeg_sources/ffmpeg/libavformat/swfdec.c:523: undefined
> > reference to `inflateEnd'
> >
> > /usr/local/lib/libavcodec.a(cscd.o): In function `decode_frame':
> >
> > /home/ubuntu/ffmpeg_sources/ffmpeg/libavcodec/cscd.c:91: undefined
> > reference to `uncompress'
> >
> > /usr/local/lib/libavcodec.a(dxa.o): In function `decode_frame':
> >
> > /home/ubuntu/ffmpeg_sources/ffmpeg/libavcodec/dxa.c:250: undefined
> > reference to `uncompress'
> >
> >
> > the list of undefined reference errors is quite huge.
> >
> > the command which i am using to link looks like this--
> >
> > g++  file1.o file2.o file3.o  -L/usr/lib/x86_64-linux-gnu
> -L/usr/local/lib
> > -L/home/ubuntu/casablanca/Release/build.release/Binaries -lpthread
> > -lavutil  -lavformat
> > -lavcodec -lavfilter -lboost_system -lboost_thread -lboost_chrono
> -lcpprest
> > -lswscale -o final
>
>
> Hmm try linking with -lzlib too.
>

After some trial and errors i figured out the command to make it work. i
had to link lzlib, libx264, libfdk-aac ,libopus -libva to make it work.

-lavformat -lavcodec -lavutil -lpthread -lz -lfdk-aac -lx264 -lopus
-lswresample -lva -lboost_system -lboost_thread -lboost_chrono -lcpprest
 I wonder why the build worked on my mac with just following libs  -
-lavformat -lavcodec -lavutil -lboost_system -lboost_thread -lboost_chrono
-lcpprest

>
> > the issue seems to be related to order of linking. is there a mistake in
> > order in which i am linking the libs.
> > PS - lpthread was not required when i was building on my mac.
> >
> > following is the output of ffmpeg -i
> >
> > ffmpeg version N-75410-g58fe57d Copyright (c) 2000-2015 the FFmpeg
> > developers
> >
> >   built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04)
> >
> >   configuration: --enable-gpl --enable-libfdk-aac --enable-libx264
> > --enable-libopus --enable-nonfree
> >
> >   libavutil      55.  2.100 / 55.  2.100
> >
> >   libavcodec     57.  3.100 / 57.  3.100
> >
> >   libavformat    57.  2.100 / 57.  2.100
> >
> >   libavdevice    57.  0.100 / 57.  0.100
> >
> >   libavfilter     6.  5.100 /  6.  5.100
> >
> >   libswscale      4.  0.100 /  4.  0.100
> >
> >   libswresample   2.  0.100 /  2.  0.100
> >
> >   libpostproc    54.  0.100 / 54.  0.100
> >
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20150918/d89e99b8/attachment.html>


More information about the Libav-user mailing list