On modern UNIX systems shared objects are used and loading is done using dlopen(). The argument of load/1 must be a shared object (.so file).
On Windows systems dynamic libraries are used. The argument of load/1 must be a .dll file.
To write portable programs, it is possible to query the value of the flag object_suffix. It gives the correct file extensions for the loadable objects on the current platform (e.g. "so", "dll").
Success:
% See the msg.c example source in external/2.
% eclipse
% load the .o file dynamically into the system
[eclipse]: load('msg.so').
yes.
[eclipse]: get_flag(prmsg/1,visibility,Vis).
accessing an undefined procedure
% link the object file with a predicate definition.
[eclipse]: external(prmsg/1,"p_prmsg").
yes.
% check on existence and flags of prmsg/1.
[eclipse]: get_flag(prmsg/1,type,V),
get_flag(prmsg/1,tool,T),
get_flag(prmsg/1,visibility,Vis).
V = user
T = off
Vis = local More? (;)
yes.
Error:
[eclipse]: load('msg.c').
system interface error: Unknown system error
% not loading an object file.
[eclipse]: load('msg.o').
system interface error: No such file or directory
% no compilation of msg.c to give msg.o
load(F). (Error 4).
load(msg(o)). (Error 5).