You are not logged in.

#1 2009-06-28 15:22:56

Revolt
Member
From: Portugal
Registered: 2009-06-11
Posts: 71
Website

Compiling Box2D

Here I am to seek help in yet another problem.

I'm working on a game engine that uses the Box2D library for physics simulation. As such, I searched the AUR and found a package there. Neat! Tried to install it but it only had the i686 tag on it so it wouldn't run. I then tried again, this time adding the x86_64 tag and it managed to grab the sources from svn. However, while compiling, it throws this error and doesn't install:

Gen/float/./Dynamics/b2Body.o: relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
Gen/float/./Dynamics/b2Body.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: *** [Gen/float/libbox2d.so] Error 1
make[1]: *** [all] Error 2

I then tried manually compiling the sources by downloading them from the Box2D site and running make. However, this time, a new error came up, saying that memcpy was not declared. That file includes memory.h which in turn includes string.h where there's a memcpy external declaration so I cannot see what's the problem.

Can you guys help me?

Thank you in advance smile

Offline

#2 2009-06-28 18:51:48

djgera
Developer
From: Buenos Aires - Argentina
Registered: 2008-12-24
Posts: 723
Website

Re: Compiling Box2D

you need to compile all objext files that will be part of the shared library with -fPIC

See in the build system if there any way to do this, otherwise you need to do manually.

Offline

#3 2009-06-29 11:23:58

Revolt
Member
From: Portugal
Registered: 2009-06-11
Posts: 71
Website

Re: Compiling Box2D

Ok I managed to compile Box2D by using this repository created to fix some Linux-specific make problems.

http://www.box2d.org/forum/viewtopic.php?f=7&t=2375

I had to add the -fPIC flag to the CXXFlags in Build/gnumake/config.mk for it to work on 64 bits though.
Thanks wink

Offline

Board footer

Powered by FluxBB