Loads foreign object files into Prolog. Relies on the hook
load_foreign_files/2 takes a list of object files and a list of
shared libraries, links them and then loads the result into
Prolog. The linking is done using the system linker.
For details on the call to the linker, see fli-p2f-lff.
The extension can be omitted from the filenames given in the ObjectFiles argument.
foreign_file/2 facts defined by the
user to make the connection between a Prolog procedure and the foreign
function. When loading each object file, it looks for a
foreign_file/2 fact for the object file and for each symbol in
foreign_file/2 fact it looks for a
foreign/3 fact that
gives the name of the Prolog procedure associated with the foreign
symbol and the argument specification.
foreign_file/2 facts defined in
its source module only.
Looks at the environment variable
TMPDIR for the directory to store
all the temporary files created during the linking and loading
process. The default directory is
Before calling this predicate, generate the object files for the foreign functions using the foreign language compiler. The object files should contain position independent code; see fli-p2f-uso.
Errors in the specification of
foreign/3 will all be reported when
load_foreign_files/2 is called.
See example under