'recompile with -fPIC'

skalman
Posts: 1
Joined: Wed Jun 22, 2011 9:23 am

'recompile with -fPIC'

Post by skalman »

I'm trying to use Bullet in a plugin for OpenRAVE on Ubuntu 10.04, but I get this error:

Code: Select all

/usr/bin/ld: /usr/local/lib/libBulletDynamics.a(btTypedConstraint.o): relocation R_X86_64_32S against `vtable for btTypedConstraint' can not be used when making a shared object; recompile with -fPIC
So my question is: How do I recompile Bullet with -fPIC? I'm fairly new to Ubuntu and Bullet Physics, so a detailed answer would be very much appreciated.

Thank you!
Leonardo
Posts: 4
Joined: Wed Jul 13, 2011 9:24 am

Re: 'recompile with -fPIC'

Post by Leonardo »

Compiling bullet is a matter of following this link on the wiki: http://bulletphysics.org/mediawiki-1.5. ... n#Building. Make sure passing -DBUILD_SHARED_LIBS as a cmake option.
This error is common on x86_64/amd64, I had the same a while ago. IMHO, you should report this as a bug in the ubuntu launchpad (or the people that manages this ubuntu package), for 64 bit architectures this will always happen when using the gcc version you're using.