[Libav-user] Error while linking

gaurav mishra gauravmishra.itbhu at gmail.com
Fri Sep 18 15:50:59 CEST 2015


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
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20150918/ae63bdc7/attachment.html>


More information about the Libav-user mailing list