0

I compiled ffmpeg on clear lubuntu and whiled attaching libs to my project in eclipse I got bunch of errors:

/usr/local/lib//libavformat.a(mov.o): In function `mov_read_sbgp':
/root/ffmpeg/libavformat/mov.c:2039: undefined reference to `av_malloc'
/usr/local/lib//libavformat.a(mov.o): In function `mov_read_dac3':
/root/ffmpeg/libavformat/mov.c:647: undefined reference to `avpriv_ac3_channel_layout_tab'
/usr/local/lib//libavformat.a(mov.o): In function `mov_read_tfhd':
/root/ffmpeg/libavformat/mov.c:2559: undefined reference to `av_log'
/usr/local/lib//libavformat.a(mov.o): In function `mov_read_stts':
/root/ffmpeg/libavformat/mov.c:1908: undefined reference to `av_malloc'
/root/ffmpeg/libavformat/mov.c:1921: undefined reference to `av_log'
/root/ffmpeg/libavformat/mov.c:1925: undefined reference to `av_log'
/usr/local/lib//libavformat.a(mov.o): In function `mov_read_stss':
/root/ffmpeg/libavformat/mov.c:1790: undefined reference to `av_malloc'
/usr/local/lib//libavformat.a(mov.o): In function `mov_read_stsc':
/root/ffmpeg/libavformat/mov.c:1712: undefined reference to `av_malloc'

Its only a part of output..Could somoone help me with that staff? I stucked here, thx.

Also I give u some info about ld --verbose -l avformat:

attempt to open /usr/i686-linux-gnu/lib32/libavformat.so failed
attempt to open /usr/i686-linux-gnu/lib32/libavformat.a failed
attempt to open /usr/local/lib32/libavformat.so failed
attempt to open /usr/local/lib32/libavformat.a failed
attempt to open /lib32/libavformat.so failed
attempt to open /lib32/libavformat.a failed
attempt to open /usr/lib32/libavformat.so failed
attempt to open /usr/lib32/libavformat.a failed
attempt to open /usr/local/lib/i386-linux-gnu/libavformat.so failed
attempt to open /usr/local/lib/i386-linux-gnu/libavformat.a failed
attempt to open /usr/local/lib/libavformat.so failed
attempt to open /usr/local/lib/libavformat.a succeeded
ld: warning: cannot find entry symbol _start; not setting start address

Everything is going to be problem with avutil....all undefined reference comes from files of libavutil. But I have no idea why and what to do.

Pawel Rutka
  • 53
  • 1
  • 8
  • Is `libavutil` the only library file of `ffmpeg`? I suppose it has additional dependencies on other libraries. Have a look at [this](http://stackoverflow.com/questions/22430306/gcc-undefined-reference-error/22431021#22431021), he compiles project with `-lavfilter` and `-lavcodec` (and `-lpthread` also). – Oleg Andriyanov Mar 22 '14 at 19:33
  • It doesnt change anything... – Pawel Rutka Mar 22 '14 at 19:40
  • Please provide the arguments you pass to the compiler. – Oleg Andriyanov Mar 22 '14 at 19:47
  • U mean while comiling project not ffmpeg? g++ -L/usr/local/lib/ -o "test" ./src/test.o -lpthread -lavfilter -lavcodec -lavutil -lavformat ./src/test.o: In function `main': – Pawel Rutka Mar 22 '14 at 19:54
  • See [this question](http://stackoverflow.com/questions/45135/linker-order-gcc). Try to move `-lavutil` to the end of your libraries list. – Oleg Andriyanov Mar 22 '14 at 19:59
  • Did it witchout any progress. I think livavformat depend on libavutil. What is more I compile this ffmpeg 3 times on fresh system and always got the same error while linking into a project – Pawel Rutka Mar 22 '14 at 20:02
  • Hah... You gotta righ..) now I am dealing with undefined vpx_codec_error -- tryinf find out that lib. – Pawel Rutka Mar 22 '14 at 20:15
  • You can post answer to your own question and accept it so that it would not be "unanswered" in search anymore. – Oleg Andriyanov Mar 22 '14 at 20:33
  • I will do it but i need wait 8h - no reputation here! Thx – Pawel Rutka Mar 22 '14 at 22:01

1 Answers1

1

By given help i managed to solve problem so let me share with You. For compilation guid

How to set up ffmpeg for dev

use this linking order:

avdevice
avfilter
postproc
avformat
avcodec
rt
dl
Xfixes
Xext
X11
asound
SDL
vorbisenc
vorbis
theoraenc
theoradec
ogg
opencore-amrwb
opencore-amrnb
z
rt
swresample
swscale
avutil
m
z
swresample
faac
mp3lame
vpx
x264
xvidcore
pthread
Pawel Rutka
  • 53
  • 1
  • 8