I am trying to build osg v 3.4 following the github readme, however i get the following compilation error after on the make VERBOSE=1
step:
[ 94%] Linking CXX shared module ../../../lib/osgPlugins-3.4.0/osgdb_ffmpeg.so
cd /home/workdir/osg_tst/osg/build/src/osgPlugins/ffmpeg && /usr/local/bin/cmake -E cmake_link_script CMakeFiles/osgdb_ffmpeg.dir/link.txt --verbose=1
/usr/local/bin/c++ -fPIC -Wall -Wparentheses -Wno-long-long -Wno-import -pedantic -Wreturn-type -Wmissing-braces -Wunknown-pragmas -Wunused -Wno-deprecated-declarations -O3 -DNDEBUG -shared -o ../../../lib/osgPlugins-3.4.0/osgdb_ffmpeg.so CMakeFiles/osgdb_ffmpeg.dir/FFmpegClocks.o CMakeFiles/osgdb_ffmpeg.dir/FFmpegDecoderAudio.o CMakeFiles/osgdb_ffmpeg.dir/FFmpegDecoder.o CMakeFiles/osgdb_ffmpeg.dir/FFmpegDecoderVideo.o CMakeFiles/osgdb_ffmpeg.dir/FFmpegImageStream.o CMakeFiles/osgdb_ffmpeg.dir/FFmpegAudioStream.o CMakeFiles/osgdb_ffmpeg.dir/FFmpegParameters.o CMakeFiles/osgdb_ffmpeg.dir/ReaderWriterFFmpeg.o -Wl,-rpath,/home/workdir/osg_tst/osg/build/lib: ../../../lib/libosgDB.so.3.4.0 ../../../lib/libosgUtil.so.3.4.0 -Wl,-Bstatic -lavformat -lavdevice -lavcodec -lavutil -lswscale -lswresample -Wl,-Bdynamic ../../../lib/libosg.so.3.4.0 ../../../lib/libOpenThreads.so.3.3.0 -lpthread -lm -lrt -ldl -lz -lGL
/usr/bin/ld: /usr/local/lib/gcc/x86_64-linux-gnu/12.2.0/../../../libavformat.a(allformats.o): relocation R_X86_64_32 against symbol `ff_a64_muxer' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/gcc/x86_64-linux-gnu/12.2.0/../../../libavformat.a(amr.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/gcc/x86_64-linux-gnu/12.2.0/../../../libavformat.a(anm.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/gcc/x86_64-linux-gnu/12.2.0/../../../libavformat.a(apc.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
.
.
.
collect2: error: ld returned 1 exit status
make[2]: *** [src/osgPlugins/ffmpeg/CMakeFiles/osgdb_ffmpeg.dir/build.make:224: lib/osgPlugins-3.4.0/osgdb_ffmpeg.so] Error 1
make[2]: Leaving directory '/home/workdir/osg_tst/osg/build'
make[1]: *** [CMakeFiles/Makefile2:5205: src/osgPlugins/ffmpeg/CMakeFiles/osgdb_ffmpeg.dir/all] Error 2
make[1]: Leaving directory '/home/workdir/osg_tst/osg/build'
make: *** [Makefile:136: all] Error 2
The list of error goes on, but i am only showing the first three for clarity, as they all match the same error.
The error recommends using the -fPIC option, however it is clearly already in use in the command displayed.
From the gcc documentation It should have something to do with the architecture used, but the project is also already in 64 bit, as is my linux architecture in x86_64, so what am i missing here?