I am using object file in my Delphi application over Linux Platform and linked them as shown in below piece of code and getting error:
"E2065 Unsatisfied forward or external declaration: 'add'"
Delphi:
program ITP_Test;
{$APPTYPE CONSOLE}
{$R *.res}
uses
System.SysUtils;
{$LINK 'hello.o'}
function add(a ,b : Integer): Integer; cdecl; external;
begin
Writeln(add(2,7));
end.
hello.c
#include<stdio.h>
#ifdef __cplusplus
extern "C"
{
#endif
int add(int a, int b)
{
return a + b;
}
#ifdef __cplusplus
}
#endif
compiled hello.c using command:
'gcc -c hello.c'
gcc version : 7.5.0 Linux version: Ubuntu 18.04