Gazebo | Ignition | Community
Ask Your Question

Gazebo install error when linking shared library

asked 2016-12-07 06:22:24 -0500

SamanthaTraynor65 gravatar image

updated 2016-12-08 11:39:35 -0500

chapulina gravatar image

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
/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/' failed
make[2]: *** [gazebo/common/] 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?

edit retag flag offensive close merge delete


I've tried to recompile libtar with fPIC "make COMPILE_FLAGS+=-fPIC" "sudo make install" but error with Gazebo is still here

SamanthaTraynor65 gravatar imageSamanthaTraynor65 ( 2016-12-07 06:43:07 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2016-12-08 07:26:50 -0500

SamanthaTraynor65 gravatar image

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

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2016-12-07 06:21:36 -0500

Seen: 266 times

Last updated: Dec 08 '16