Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2016-02

Building Android cross compiler error

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Ryan Joseph

I’ve downloaded FPC 3.0.0 and updated the sources from SVN then downloaded the Android NDK (Mac OS X 64-bit was the only option for Mac). The script seems to work but I’m getting this error after compiling for some time.

Any ideas what’s going on?

======

cd /Developer/ObjectivePascal/fpc
INSTALL_PATH=/Developer/Android
PATH=$PATH:$INSTALL_PATH/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin

make clean all crossinstall OS_TARGET=android CPU_TARGET=arm CROSSOPT="-Cfvfpv3" INSTALL_PREFIX=$INSTALL_PATH

=====

/Developer/Android/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-ld.bfd: cannot find -lc pp.pas(219,36) Error: Error while linking
pp.pas(219,36) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted
make[3]: *** [ppcarm] Error 1
make[2]: *** [cycle] Error 2
make[1]: *** [compiler_cycle] Error 2
make: *** [build-stamp.arm-android] Error 2

Regards,
Ryan Joseph

Reply by email

Michalis Kamburelis
to Ryan Joseph
/Developer/Android/android-ndk-r10e/toolchains/arm-linux-

androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-ld.bfd: cannot find -lc
pp.pas(219,36) Error: Error while linking

Have you defined the -Fl option correctly?

For example, I put something like this in my ~/.fpc.cfg:

#ifdef android

#ifdef cpuarm

-Fl/home/michalis/.../android/ndk/platforms/android-19/arch-arm/usr/lib/

#endif

#ifdef cpu386

-Fl/home/michalis/.../android/ndk/platforms/android-19/arch-x86/usr/lib/

#endif

#endif

You can see Castle Game Engine instructions about setting up Android+FPC environment on https://github.com/castle-engine/castle-engine/wiki/Android :)

Michalis

Reply by email

Ryan Joseph
to Michalis Kamburelis

Isn’t that step after the compiler has been built? I was following the guide at http://wiki.freepascal.org/Android and they said to just add to the $PATH variable and then create the config file later so I didn’t even get to that step since the compiling failed.

Show quoted text 16 lines
On Feb 23, 2016, at 1:53 PM, Michalis Kamburelis wrote: Have you defined the -Fl option correctly? For example, I put something like this in my ~/.fpc.cfg: #ifdef android #ifdef cpuarm -Fl/home/michalis/.../android/ndk/platforms/android-19/arch-arm/usr/lib/ #endif #ifdef cpu386 -Fl/home/michalis/.../android/ndk/platforms/android-19/arch-x86/usr/lib/ #endif #endif

Regards,
Ryan Joseph

Reply by email