What to do with "recompile with -fPIC" message

22,729

Solution 1

There is a ./configure option which might be the easiest way to solve the issue:

andrew@ilium~/source/ffmpeg_build/ffmpeg/ffmpeg$ ./configure --help | grep -i pic
--enable-pic             build position-independent code

Solution 2

I have solved the same error for compiling FFMpeg 2.3.3 sources at Ubuntu 14.04 LTS. I have successfuly compiled the code after set LD_LIBRARY_PATH to /usr/lib/x86_64-linux-gnu and added -fPIC flag to --cc. My working compile commands is here :

LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu
./configure --prefix=.. --enable-shared --enable-gpl --enable-version3 --enable-runtime-cpudetect --disable-outdev=sdl --disable-opencl --enable-libmp3lame --enable-libx264 --cc="gcc -m64 -fPIC" --extra-cflags="-I../include" --extra-ldflags="-L../lib -ldl"
make -j4
Share:
22,729

Related videos on Youtube

A1A2A3A4
Author by

A1A2A3A4

Updated on September 18, 2022

Comments

  • A1A2A3A4
    A1A2A3A4 over 1 year

    I'm trying to configure the ffmpeg source package to build .so files rather than .a files.

    I run make after doing ./configure --enable-shared

    This gives me the following message:

    /usr/bin/ld: libavutil/display.o: relocation R_X86_64_PC32 against undefined symbol 'hypot@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC

    However, I'm not sure where and how to add the -fPIC flag.

    • saiarcot895
      saiarcot895 almost 10 years
      .so files are the standard in Ubuntu. In which (binary) packages are you unable to find .so files?
  • Admin
    Admin about 9 years
    don`t forget to make clean after adding -fPIC flag