0

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!

NotCras
  • 1
  • 1
  • 4
  • Take sources from https://github.com/FFmpeg/FFmpeg, and execute `./configure --enable-pic && make su make install` as suggested in the comment 6 for bugreport you refer to. `I don't want to mess up my computer.` - generally, this intention involves many things (not only when you install programs). There are numerious advices for this topic in the net. Specifically about installing software, check this question: https://stackoverflow.com/questions/3239343/make-install-but-not-to-default-directories. – Tsyvarev Jun 21 '17 at 19:57
  • ok, I'll try this out. Thanks for the quick response! – NotCras Jun 21 '17 at 21:53
  • This worked. Ran into another issue that was solved with: `./configure --enable-pic --enable-shared && make && sudo make install`. Thanks again! – NotCras Jun 21 '17 at 23:05

0 Answers0