Linker problem when compiling for android

Official forum for the Chipmunk2D Physics Library.

Linker problem when compiling for android

Postby viblo » Sun Feb 26, 2017 11:31 am

Im trying to compile Chipmunk using the NDK for Android (my end goal is to run pymunk on android).

I downloaded the ndk (android-ndk-r13b), then made a toolchain with this command

Code: Select all
android-ndk-r13b-linux-x86_64/android-ndk-r13b/build/tools/make_standalone_toolchain.py --arch armeabi-v7a --api 19 --install-dir /media/sf_code/kivytest/ndk


Then run the compilation (Same way for all the source files, but only include one here)
Code: Select all
arm-linux-androideabi-gcc -DANDROID -mandroid -fomit-frame-pointer --sysroot /media/sf_code/kivytest/ndk/sysroot -std=gnu99 -DCHIPMUNK_FFI -g -DCP_USE_CGPOINTS=0 -DNDEBUG -DANDROID -mandroid -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -Ichipmunk_src/include -c chipmunk_src/src/chipmunk.c -o chipmunk_src/src/chipmunk.o

And finally I try to link it:
Code: Select all
arm-linux-androideabi-ld -march=armv7-a -lm -L-llog -lc -landroid -L/lib/gcc/arm-linux-androideabi/4.9.x/armv7-a -L/media/sf_code/kivytest/ndk/lib/gcc/arm-linux-androideabi/4.9.x/armv7-a -lgcc --sysroot /media/sf_code/kivytest/ndk/sysroot chipmunk_src/src/chipmunk.o chipmunk_src/src/cpArbiter.o chipmunk_src/src/cpArray.o chipmunk_src/src/cpBBTree.o chipmunk_src/src/cpBody.o chipmunk_src/src/cpCollision.o chipmunk_src/src/cpConstraint.o chipmunk_src/src/cpDampedRotarySpring.o chipmunk_src/src/cpDampedSpring.o chipmunk_src/src/cpGearJoint.o chipmunk_src/src/cpGrooveJoint.o chipmunk_src/src/cpHashSet.o chipmunk_src/src/cpHastySpace.o chipmunk_src/src/cpMarch.o chipmunk_src/src/cpPinJoint.o chipmunk_src/src/cpPivotJoint.o chipmunk_src/src/cpPolyline.o chipmunk_src/src/cpPolyShape.o chipmunk_src/src/cpRatchetJoint.o chipmunk_src/src/cpRobust.o chipmunk_src/src/cpRotaryLimitJoint.o chipmunk_src/src/cpShape.o chipmunk_src/src/cpSimpleMotor.o chipmunk_src/src/cpSlideJoint.o chipmunk_src/src/cpSpace.o chipmunk_src/src/cpSpaceComponent.o chipmunk_src/src/cpSpaceDebug.o chipmunk_src/src/cpSpaceHash.o chipmunk_src/src/cpSpaceQuery.o chipmunk_src/src/cpSpaceStep.o chipmunk_src/src/cpSpatialIndex.o chipmunk_src/src/cpSweep1D.o -o build/lib.linux-x86_64-2.7/pymunk/libchipmunk64.so


And the output is a log of undefined references (I just included part of them here):
Code: Select all
chipmunk_src/include/chipmunk/chipmunk_types.h:121: error: undefined reference to '__aeabi_dcmpgt'
chipmunk_src/include/chipmunk/chipmunk_types.h:127: error: undefined reference to '__aeabi_dcmplt'
chipmunk_src/include/chipmunk/chipmunk_types.h:133: error: undefined reference to '__aeabi_dcmplt'
chipmunk_src/include/chipmunk/chipmunk_types.h:153: error: undefined reference to '__aeabi_dsub'
chipmunk_src/include/chipmunk/chipmunk_types.h:153: error: undefined reference to '__aeabi_dmul'
chipmunk_src/include/chipmunk/chipmunk_types.h:153: error: undefined reference to '__aeabi_dmul'
chipmunk_src/include/chipmunk/chipmunk_types.h:153: error: undefined reference to '__aeabi_dadd'
chipmunk_src/include/chipmunk/chipmunk_types.h:159: error: undefined reference to '__aeabi_dsub'
chipmunk_src/include/chipmunk/chipmunk_types.h:159: error: undefined reference to '__aeabi_dadd'
chipmunk_src/include/chipmunk/cpVect.h:44: error: undefined reference to '__aeabi_dcmpeq'
chipmunk_src/include/chipmunk/cpVect.h:44: error: undefined reference to '__aeabi_dcmpeq'


Any idea what I can do to fix it?
http://www.pymunk.org - A python library built on top of Chipmunk to let you easily get cool 2d physics in your python game/app
viblo
 
Posts: 205
Joined: Tue Aug 21, 2007 3:12 pm

Re: Linker problem when compiling for android

Postby viblo » Sun Mar 26, 2017 4:07 pm

Turns out I could fix this by linking against python2.7 (im building it with python-for-android).
http://www.pymunk.org - A python library built on top of Chipmunk to let you easily get cool 2d physics in your python game/app
viblo
 
Posts: 205
Joined: Tue Aug 21, 2007 3:12 pm


Return to Chipmunk2D Physics

Who is online

Users browsing this forum: No registered users and 3 guests