[fpc-pascal] android share library with classes unit

Dariusz Mazur darekm at emadar.com
Tue Apr 12 15:03:08 CEST 2011


  W dniu 2011-04-12 11:56, herux pisze:
> I managed to compile and run the library for android on emulator, 
> which I compile the project just a libhellojni.so compile using 
> paramater like this ppcarm -Scghi -O1 -Parm -gl -b -B -XX -Xc -XD 
> -CpARMv6 -CfSOFT -dandroid -vewnhi -l -XParm-linux- 
> -Fi/home/herux/workspace/hellojni/jni/lib/arm-linux/ -Fu. 
> -FUlib/arm-linux/ -o../libs/armeabi/libhellojni.so 
> -FD/usr/share/fpcsrc/binutils/ hellojni.lpr on Kubuntu 10.04 x86_64 
> library code: library hellojni; {$ ifdef fpc} {$ mode delphi} {$ 
> endif} uses JNI, log; Java_com_herux_hellojni_MainActivity_Hellojni 
> function (env: PJNIEnv; Thiz: jobject): jstring; cdecl; begin result: 
> = env ^. NewStringUTF (env, PChar ('Hello JNI from FreePascal ..')); 
> end; exports Java_com_herux_hellojni_MainActivity_Hellojni name 
> 'Java_com_herux_hellojni_MainActivity_Hellojni'; begin end; then I try 
> to use classes unit or sysutils, the project succeeded in compiling, 
> but the library did not loaded by the emulator. there is an error 
> SIGSEGV D/dalvikvm( 1082): Trying to load lib 
> /data/data/com.herux.hellojni/lib/libhellojni.so 0x44e7ea48 I/DEBUG ( 
> 31): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 
> I/DEBUG ( 31): 

How You prepare crosscompiler
  did You use -dARMEL -CpARMv6

or problems with binutils





On Android each bug in linking is showing the same


   Darek







More information about the fpc-pascal mailing list