Here's what's going on. I'm trying to set up OpenSceneGraph, however I run into the following error during the make process (spaces added for easier reading):
/usr/bin/ld: /usr/local/lib/libavformat.a(allformats.o): relocation R_X86_64_32 against `ff_a64_muxer' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libavformat.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
src/osgPlugins/ffmpeg/CMakeFiles/osgdb_ffmpeg.dir/build.make:291: recipe for target 'lib/osgPlugins-3.4.0/osgdb_ffmpeg.so' failed
make[2]: *** [lib/osgPlugins-3.4.0/osgdb_ffmpeg.so] Error 1
CMakeFiles/Makefile2:6663: recipe for target
'src/osgPlugins/ffmpeg/CMakeFiles/osgdb_ffmpeg.dir/all' failed
make[1]: *** [src/osgPlugins/ffmpeg/CMakeFiles/osgdb_ffmpeg.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
This error does not stop the cmake process. A little later (error above occurs at 39%, process fails at 46%), I get this error:
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
Then the process stops.
I've looked at some other solutions, but they didn't have what I needed (here and here). I've run cmake with the -fPIC flag and that didn't solve anything.
I found a potential solution here but I don't know how to implement "recompile your FFmpeg/libavcodec/libavformat with pic enabled". Can anyone talk me through it or give me a good resource? I've never done it before and I don't want to mess up my computer.
Any help would be much appreciated. Thanks in advance!