Hi!
The following project throws a linker error - (checked on a raspi 4, CodeTyphon IDE. Additional compiler options -fPIC -Xc
I stumbled over this when trying to create an apache module on the RPi4... These modules need to export a record but I cannot
fill .... Anything that I'm missing here? How can I fill the record and exort the data?
library exportTest;
{$mode objfpc}{$H+}
uses
Classes
{ you can add units after this };
type
TTestRec = packed record
idx1 : integer;
idx2 : integer;
end;
var idxData : TTestRec; export name 'idxData';
procedure InitData(i1, i2 : integer);
begin
idxData.idx1 := i1;
idxData.idx2 := i2;
end;
exports idxData, InitData;
begin
end.
the think is ... why? Why is it not allowed to change the content of the exported variable at all?