1

I'm trying to build dschaefer android-box2d, and did follow the recipe. I do get this error when trying to build the TestBox2d with eclipse:


make all /cygdrive/c/android/android-ndk-r3/build/prebuilt/windows/arm-eabi-4.2.1/bin/arm-eabi-ld \ -nostdlib -shared -Bsymbolic --no-undefined \ -o obj/libtest.so obj/test.o -L../box2d/lib/android -lbox2d \ -L/cygdrive/c/android/android-ndk-r3/build/platforms/android-3/arch-arm/usr/lib \ -llog -lc -lstdc++ -lm \ /cygdrive/c/android/android-ndk-r3/build/prebuilt/windows/arm-eabi-4.2.1/lib/gcc/arm-eabi/4.2.1/interwork/libgcc.a \

/cygdrive/c/android/android-ndk-r3/build/prebuilt/windows/arm-eabi-4.2.1/bin/arm-eabi-ld: cannot find -lbox2d make: *** [obj/libtest.so] Error 1


The only thing I did change was in the TestBox2d\Makefile where i did change the path to the NDK.

There are some other that have the same problem HERE but I do not know how to fix it.

4

1 に答える 1

0

このエラーは、リンカがライブラリ box2d を見つけられないことを示しています。

私が問題だと思うのは、box2d ライブラリ ( ) の場所を指す相対パスがあることです-L../box2d/lib/android。ビルド ディレクトリが変更されると、ビルドが壊れます。box2d ライブラリの絶対パス ( など-L/cygdrive/c/box2d/lib/android) を代入することもできます。NDK への他のすべてのリンク パスは絶対パスです。

より良い方法は、box2d ライブラリへのパスを環境変数に入れ、この環境変数を makefile で使用することです。

于 2010-05-15T12:40:59.093 に答える