A
dynamically loadable library is a dynamic-link library (DLL) on Windows or a
shared object library file on Linux. It is a collection of routines that can be
called by applications and by other DLLs or shared objects. Like units,
dynamically loadable libraries contain sharable code or resources. But this
type of library is a separately compiled executable that is linked at runtime
to the programs that use it.
To
distinguish them from standalone executables, on Windows files containing
compiled DLLs are named with the .DLL extension. On Linux, files containing
shared object files are named with a .so extension. Object Pascal programs can
call DLLs or shared objects written in other languages, and applications
written in other languages can call DLLs or shared objects written in Object
Pascal.
Writing
dynamically loadable libraries
动态可加载库在Windows中是指动态链接库(DLL),在Linux中是指共享对象文件。动态可加载库是一些例程的集合,这些例程可以被应用程序、其他的动态链接库或共享对象调用。和单元一样,动态可加载库含有共享的代码或资源。然而,这种库单独被编译成可执行文件,在运行时连接到使用它的程序。
为区别动态可加载库和独立的可执行文件,在Windows中,含有编译过的动态链接库文件命名时以.DLL为扩展文件名;在Linux中,含有共享对象的文件命名时以.so为扩展文件名。Object Pascal程序可以调用以其他语言编写的动态链接库(DLLs)或共享对象,而用其他语言编写的应用程序也可以调用由Object Pascal语言编写的动态链接库(DLLs)或共享对象。