Is there a special thing I need to do to get Lazarus to build an SO on Linux?
I got the SO to compile with the Compiler Options / Linker stuff all set to "smart" mode. And it built.
TCBMyTest=function(Var Output:TCharArray):boolean;
Var
MyTest:TCBMyTest;
MyBuffer:TCharArray;
procedure TForm1.OnFormCreate();
begin
FHandle:=LoadLibrary(/complete/path/test.so);
Pointer(MyTest):=DynLibs.GetProcAddress(FLibHandle,'MyTest');
end;
procedure TForm1.Button1Click();
begin
MyTest(MyBuffer);
Label1.Caption:=toString(MyBuffer);
end;
procedure TForm1.Button2Click();
begin
DynLibs.UnloadLibrary(FHandle); // <--- Raises an External Exception
//and Crashes Lazarus IDE and Application.
// Exception Dialog Project "" raised exception class 'External:SIGSEGV'.
end;
This Exception is thrown even if I don't access MyTest method in the SO.
Any calling conventions that I am supposed to use? Delphi would not have this problem in Windoze.