is there a chance that will work?
Yes! [but I dont have a test...]
Another possibility ....
[Update your LAMW from git.... I just do a minor fix to "Use/Import C stuff...."]
>>> Adventure on importing "C" stuff
Save this content as "addc.h" file in some place...
extern int add(int a, int b);
Save this content as "addc.c" file in some place... [can be the same ".h" folder]
int add(int a, int b) {
return (a+b);
}
1) Open or create a LAMW GUI project
2) Go to lazarus menu "Tools" --> "[LAMW] Android Module Wizard" --> "Use/Import C stuff"
2.1) edit/select the path to the ".c" folder
2.2) edit/select the path to the ".h" folder
2.3) edit the library name... ex. "myaddc" [the "lib" prefix wil be will be added automatically]
3) Go to your project "unit1" and append the generated header "addc" to "uses"
[warning: for complex ".h" the generated pascal header may require some adjustments ...]
uses
Classes, SysUtils, AndroidWidget, Laz_And_Controls, addc;
4) Go to Lazarus menu "Run" --> "Build"
[Success!!!]
5) Using you C "add" stuff
procedure TAndroidModule1.jButton1Click(Sender: TObject);
var
sum: longint;
begin
sum:= add(4,9); // <--- "add" from your lib C !!
ShowMessage('[Success!] sum =' + IntToStr(sum));
end;
You can look into your project folders to observe some new stuff generated....