[libav-api] problem compiling statically to make a shared lib

Andrew Kelley superjoe30 at gmail.com
Wed Sep 11 17:19:02 CEST 2013

I have compiled libav 9.9 like this:

./configure --prefix=$(pwd)/out --enable-pic
make install

I'm trying to make a shared lib which depends statically on libav, and I
get this:

$ make LIBAV_PREFIX=/home/andy/Downloads/libav-9.9/out
c99 -Isrc -D_POSIX_C_SOURCE=200809L -pedantic -Werror -Wall -g -O0 -o
example/playlist.o -c example/playlist.c
c99 -I/home/andy/Downloads/libav-9.9/out/include -pedantic -Werror -Wall -g
-O0 -fPIC  -o src/groove.o -c src/groove.c
c99 -shared -Wl,-soname,libgroove.so -o src/libgroove.so src/groove.o
/home/andy/Downloads/libav-9.9/out/lib/libavutil.a -lSDL -lbz2 -lz -lm
/usr/bin/ld: /home/andy/Downloads/libav-9.9/out/lib/libavcodec.a(lpc.o):
relocation R_X86_64_PC32 against symbol `ff_pd_1' can not be used when
making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
make: *** [src/libgroove.so] Error 1

See my makefile here:

system: Linux andy-xps 3.8.0-29-generic #42-Ubuntu SMP Tue Aug 13 19:40:39
UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

Any ideas?

More information about the libav-api mailing list