HP Pascal/iX Programmer's Guide (31502-90023)
2-: 5
Figure 2-3 . shows what a module can access.
Figure 2-3. What a Module Can Access
A module must be compiled before a program or another module imports it
(therefore, two modules cannot import each other).
For the compiler to compile a module with a program, the program must
define the module in its declaration part. After defining this module,
the program can import it.
When compiling a module independently of a program, the compiler stores
the compiled module in the object file or in an alternate file named in
the MLIBRARY option (if the MLIBRARY option is specified).
When compiling modules separately or with a program, the placement of the
compiler output depends on whether the MLIBRARY option is used. If
MLIBRARY is used, the module-text (in the IMPORT and EXPORT declaration)
is placed in the file specified with the MLIBRARY option.
If MLIBRARY is not used, the module-text is placed into the object file
along with the object code. The module-text present in object files also
occurs in RLs (archive libraries), shared libraries, XLs, and program
files that were created from these object files unless stripped or the
Linkeditor's NODEBUG option is used. Even though the module-text is an
unloadable space, it does take up room in the file.
The compiler can extract the module-text from Mlibraries or from any of
the binary files discussed above.
NOTE The compiler may not be able to extract this information if the
file is loaded.
The importing program uses the compiler option SEARCH to tell the
compiler where to find the module. The compiler options MLIBRARY and
SEARCH cannot specify the same library. For more information on MLIBRARY