Forum > Android

Crosscompile dynlibs.pas error

(1/3) > >>

viroroi:
I install in Ubuntu 11.10 Lazarus 0.9.31 with FPC 2.5.1 crosscompile for Android.

When I compile a project with dynlibs.pas if I link libpthread.so, libc.so and libdl.so to "arm-linux-gnueabi" forder:
sudo ln -sf /usr/arm-linux-gnueabi/lib/libpthread-2.13.so libpthread.so
sudo ln -sf /usr/arm-linux-gnueabi/lib/libc-2.13.so libc.so
sudo ln -sf /usr/arm-linux-gnueabi/lib/libdl-2.13.so libdl.so
These are the compiler errors:
/usr/lib/fpc/2.7.1/units/arm-linux/rtl/cprt0.o: In function `_haltproc_eabi':
(.text+0x88): undefined reference to `_fini'
/usr/lib/fpc/2.7.1/units/arm-linux/rtl/cprt0.o: In function `_haltproc_eabi':
(.text+0x90): undefined reference to `_init'
androidlcltest.lpr(23) Error: Error while linking
androidlcltest.lpr(23) Fatal: There were 1 errors compiling module, stopping

If I link libc.so and libdl.so to ndk android forder (platforms android 5) errors are similar.

I have read another thread about a similar problem but I can not found the solution.

How can I solve this problem?

Rustam Asmandiarov:
That would not produce branches think there will be fine!
So the problem! I am creating a clean design and installed in the options OS (-T) Linux, CPU (-P) Arm, LCLWidgetType-Android, name of the executable file project1.so. Compilation and run the project going.
Now add in the module uses dynlibs and compile, an error occurs:

/usr/local/bin/arm-linux-ld: warning: link.res contains output sections; did you forget -T?
/usr/local/bin/arm-linux-ld: skipping incompatible /usr/lib/crti.o when searching for /usr/lib/crti.o
/usr/local/bin/arm-linux-ld: cannot find /usr/lib/crti.o
project1.lpr(22) Error: Error while linking
project1.lpr(22) Fatal: There were 1 errors compiling module, stopping

Moreover, substitution usr / lib / crti.o and usr / lib / crtn.o desired result does not give, because there were new bugs!
OS Ubuntu 10.10-10.04

Что бы не плодить веток думаю здесь будет нормально!
Итак суть проблемы! Я создаю чистый проект и установливаю в опциях OS(-T)Linux, CPU(-P)Arm, LCLWidgetType -Android, Имя исполняемого файла project1.so. Запускаю компиляцию и проект собирается.
Теперь добавляю в uses модуль dynlibs и компилирую, появляется ошибка :
----
Причем подмена usr/lib/crti.o и usr/lib/crtn.o желаемого результата не давала, так как появлялись новые ошибки!

felipemdc:
where the source code of a minimal project which reproduces the problem?

Rustam Asmandiarov:
Here

felipemdc:
Ah, that's an LCL application ... I am rewriting the LCL Android widgetset. I don' t recommend trying to use it until I finish the rewrite.

Navigation

[0] Message Index

[#] Next page

Go to full version