Robotics StackExchange | Archived questions

Gazebo install error when linking shared library

I'm trying to install Gazebo from sources, because I need DART. Now I'm doing the step of make -j4 and having this error

[ 16%] Linking CXX shared library libgazebo_common.so
/usr/bin/ld: /usr/local/lib/libtar.a(handle.o): relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libtar.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
gazebo/common/CMakeFiles/gazebo_common.dir/build.make:1204: recipe for target 'gazebo/common/libgazebo_common.so.8.0.0' failed
make[2]: *** [gazebo/common/libgazebo_common.so.8.0.0] Error 1
CMakeFiles/Makefile2:2461: recipe for target 'gazebo/common/CMakeFiles/gazebo_common.dir/all' failed
make[1]: *** [gazebo/common/CMakeFiles/gazebo_common.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2

What should I do with this error?

Asked by SamanthaTraynor65 on 2016-12-07 07:21:36 UTC

Comments

I've tried to recompile libtar with fPIC

"make COMPILE_FLAGS+=-fPIC" "sudo make install"

but error with Gazebo is still here

Asked by SamanthaTraynor65 on 2016-12-07 07:43:07 UTC

Answers

Yep, I just used wrong way to add compiler options. The right way was "make CFLAGS+='-fPIC'"

Asked by SamanthaTraynor65 on 2016-12-08 08:26:50 UTC

Comments