You are not logged in.
Hi,
got another strange error when crosscompiling to Linux, this time on one shared library.
When I compile the same lpi project under Linux the library normally loads.
But when I try to load the same library which was crosscompiled (I only select Linux in project options, no other modification to the project), following error occurs:
procedure TPlugin.LoadModule;
var
ErrorMsg: string;
begin
if FModule = 0 then
FModule := LoadLibrary(PChar(FPath));
ErrorMsg := GetLoadErrorStr;
if FModule <> 0 then
begin
FFuncOpen := GetProcAddress(FModule, 'Open');
//etc
end;
end;
ErrorMsg has the value:
'/path_to_project/lib/i386-linux/libtest.so: undefined symbol: GENERICS.DEFAULTS$_$TORDINALCOMPARER$2$CRC09680922_$__$$_create'
and FModule is zero.
It has sth. to do with generics. Interesting is that another library using generics and crosscompiled in the same way loads fine.
I have no idea what's the problem.
Thanks
EDIT: When I removed the dependencies on Generics.* units the problem disappeared.
In fact those dependencies were not needed in this library (no generics used there).
So it seems this error only comes when some portion of Generics* is not used in the module.
Because as said in other of my libraries Generics* are used heavily and this (crosscompiled) library loaded fine.
Last edited by tklaz (2016-11-03 11:12:31)
Offline
Thanks for the feedback !
I have added the linker path into fpcupdeluxe ... do not yet know if 100% correct.
I am awaiting user feedback.
Ps: you can use fpcupdeluxe to install NewPascal anywhere !
Offline
This is the same problem as http://synopse.info/forum/viewtopic.php?id=3634.
Only here the linker runs fine but the library loader does not find requested symbol.
Don't want to dig too much into those ABI details but clean up and rebuilding the library always helps.
Offline
This could also be related:
http://bugs.freepascal.org/view.php?id=26454
Offline