First off, I'm not a C/C++ developer so be specific in your solutions and try to be understanding. Secondly, there is a similar question here that does not resolve the issue. Here is my configure line after cloning from the ffmpeg repo:
./configure --disable-debug --disable-doc \
--disable-avdevice --disable-programs \
--disable-decoders --disable-encoders \
--disable-filters --disable-muxers \
--disable-demuxers --disable-indevs \
--disable-outdevs --disable-swscale-alpha \
--disable-symver --disable-protocols \
--disable-bsfs --disable-parsers \
--disable-symver --disable-iconv \
--disable-shared --enable-static \
--enable-swresample --enable-swscale \
--enable-pthreads --enable-pic \
--enable-runtime-cpudetect --enable-asm \
--enable-yasm --enable-decoder=aac \
--enable-decoder=h264 --enable-decoder=libspeex \
--enable-parser=h264,aac --prefix="$(pwd)/linux" \
--extra-cflags="-fPIC -mcmodel=large" \
--extra-cxxflags="-fPIC -mcmodel=large" \
--pkg-config-flags="--static"
After that completes I run the following:
make clean
make
make install
I then copy the *.a files from the linux directory (my output dir, per prefix) into my project's lib folder. I then run my build and end up with this error when it gets to the linking step:
/usr/bin/ld: lib/libavcodec.a(hevc_cabac.o): relocation R_X86_64_PC32 against symbol `ff_h264_cabac_tables' 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
I am running on Ubuntu 16.04 and cannot use GPL or non-free code for this.