My point is merely something I found interesting, and probably nothing new to any of you. It applies to any operating system. I don't expect you to keep reading, but I feel it my duty to attempt to be clear rather than vague.
With FPC's LoadLibrary command, we can write a master program that allows the user to select a dynamic library to load. So we load the library, call it the "analysis library". Then what? We trust that the analysis library contains a routine called Init, and the master program runs that routine. The Init routine calls a routine made available by the master program's own dynamic library, a routine like "install_new_command", and installs a bunch of new analysis commands. which the user can now run.
Thus the analysis library declares "install_new_command" as an external, and it makes available "Init" as an export. So far as I can tell, using the "LoadLibrary" command in the master program is the only way to make this happen. So I'm grateful to Fred for showing me how to use LoadLibrary.
It turns out that, on Linux, we can compile the analysis library without linking to the library that declares "install_new_program" being present. That makes sense to me. The compiler trusts that, when the analysis library is loaded, the "install_new_program" routine will be available for dynamic linking. If it isn't, the the program will crash.
But on MacOSX, when we compile the analysis library, fpc wants to see the library declaring "install_new_command", or else it aborts with an error. That I don't understand. But I'm looking into it, and that's a subject for the MacOSX board.