You are not logged in.
Hi,
this library compiles fine but won't load when crosscompiled to Android using NewPascal FPC and added to a LAMW application:
library testlib;
{$R *.res}
uses
Generics.Collections;
function Test: PAnsiChar; cdecl;
begin
Result := 'This is library text';
end;
exports
Test;
begin
end.
Without Generics.Collections it runs. With it the LAMW app crashes when trying to load the library.
When compiled under Laz4Android it runs fine and the LAMW app does not crash.
Using the compiler options from LAMW application for the library does not help.
Where could be a problem? Bug in FPC built into Newpascal?
Thanks
Offline
Could you be more precise ?
Does Laz4Android have Generics.Collections ?
If so, does the app run fine with the combi Laz4Android+Generics.Collections ?
Offline
Try to add CThreads as first unit before Generics.Collections
best regards,
Maciej Izak
Offline
Laz4Android does not have Generics.Collections. I use those from NewPascal.
The app runs fine with these Generics.Collections, when compiled with FPC built into Laz4Android (FPC 3.1.1 2015/10/02).
The app crashes with these Generics.Collections, when compiled with FPC built into Newpascal (FPC 3.1.1 2016/10/22).
Of course different is not only FPC, but also binutils and used libraries.
Adding CThreads does not solve the problem, tried already before.
Offline
Please post a complete LAMW project, and I will try to reproduce.
Without complete project, I have to guess too much.
Offline
Problem found. It is the two distributions of Lazarus I use.
And because I take generics.* units from NewPascal to Laz4Android (have the path to them in fpc.cfg).
Switching from one Lazarus instance to another and compiling the same project in both instances is not a good idea, the linker sometimes takes wrong *.o or *.ppu files.
But clean up and rebuild always helps.
Offline