Forum > Android

crosscompile for android

(1/2) > >>

herux:
Hi all,
please help me with the following error,
I try to arm crosscompile for android OS. only a HelloWorld project that uses dynlibs.pas unit.


/helloworld$ ppcarm -Tlinux -O- -XP -Xd -Fu/usr/share/fpcsrc/rtl/units/arm-linux/ -FD/usr/share/fpcsrc/binutils/  helloworld.lpr
Free Pascal Compiler version 2.5.1 [2011/03/24] for arm
Copyright (c) 1993-2010 by Florian Klaempfl
Target OS: Linux for ARMEL
Compiling helloworld.lpr
Assembling helloworld
Compiling resource helloworld.or
Linking helloworld
/usr/share/fpcsrc/rtl/units/arm-linux/cprt0.o: In function `_start':
(.text+0x4c): undefined reference to `__libc_start_main'
/usr/share/fpcsrc/rtl/units/arm-linux/cprt0.o: In function `_haltproc_eabi':
(.text+0x88): undefined reference to `_fini'
/usr/share/fpcsrc/rtl/units/arm-linux/cprt0.o: In function `_haltproc_eabi':
(.text+0x90): undefined reference to `_init'
/usr/share/fpcsrc/rtl/units/arm-linux/dl.o: In function `DL_init':
/usr/share/fpcsrc/rtl/linux/../unix/dl.pp:100: undefined reference to `dladdr'
helloworld.lpr(80) Error: Error while linking
helloworld.lpr(80) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
I use a cross library of android NDK

thanks

felipemdc:
How have you installed FPC? Which instructions have you followed to do that?

What is the source code of your test program?

herux:
Thanks for the replay

I follows this http://wiki.lazarus.freepascal.org/Cross_compiling
or this http://alexmogurenko.com/blog/programming/android-building-free-pascal-compiler-for-android/
both links produce the same error
here is my helloworld code that work:

--- Code: ---program helloworld;
begin
  writeln('Hello android from freepascal');
end.

--- End code ---

and here is the code that error on compile,

--- Code: ---program helloworld;
uses dynlibs;
begin
  writeln('Hello android from freepascal');
end.

--- End code ---


I found this link http://honeypod.blogspot.com/2007/12/initialize-libc-for-android.html
but I don't understand yet, can someone explain it ?

EDIT:
Sorry, I am using
- ubuntu 10.04 x86_64.
- fpc from svn
- build ppcrossarm using cross binary binutils source or this http://www.codesourcery.com/

I have tried using the option -Xc to pass the linker and its compile succesfully, but if running on emulator or real device, i got "segmentation fault"

felipemdc:
Does it work if you use these instructions instead:

http://wiki.lazarus.freepascal.org/Android_Interface#Using_the_pre-compiled_compiler

?

herux:
Hi @felipemdc
I have followed your instruction, but error still the same.
now I am using mandriva 2010 on virtualbox,

what should I do now?  %)

Navigation

[0] Message Index

[#] Next page

Go to full version