You can statically link to an exported function of the .so file using Delphi's standard external
syntax on the function declaration, specifying the .so file as the external library.
Or you can dynamically load the .so into memory yourself using the dlopen()
function, retrieve a pointer to the exported function using the dlsym()
function, and release the library from memory using the dlclose()
function. These are the equivilents of LoadLibrary()
, GetProcAddress()
and FreeLibrary()
on Windows.
See this discussion for an example:
Difficulties with calling an Android NDK function from directly Delphi