[Up] [Contents] [Index] [Summary]

5.2.2 What kind of loading should I be using?

All described approaches have their advantages and disadvantages. Static linking is portable and allows for debugging on all platforms. It is relatively cumbersome and the libraries you need to pass to the linker may vary from system to system.

Loading shared objects or DLL files provides sharing and protection and is generally the best choice. The old (and also badly portable) save/[1,2] and save_program/[1,2] do not cooperate with this mechanism, but the more recent qsave_program/[1,2] can be used to created programs that load the appropriate library at startup.

Note that the definition of the foreign predicates is the same, regardless of the linking type used.