Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Blinker 5.10 Online Reference - <b> ordering the libraries</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 Ordering the libraries
------------------------------------------------------------------------------
 Script files are processed in two conceptual passes - all the FILE commands
 listing the .OBJ files to be linked, and then all the LIB and SEARCH
 commands, in the order in which they appear in the script file.

 The order of the libraries within the script file can be VERY IMPORTANT,
 particularly when multiple libraries contain routines of the same name, and
 one must be used in preference to another. The routine which will be linked
 into the program is drawn from whichever library comes first in the script
 file, which can produce unexpected results or errors if this is not the
 routine the program expected.

 When libraries refer to each other, careful consideration of the library
 order can be important to avoid the additional overhead of repeatedly
 searching libraries for unresolved references.

 Libraries should be listed within the script file in order of dependence,
 i.e. libraries which call other libraries should appear before the libraries
 to which they refer. This usually means placing non-overlayable in-house and
 third party libraries before the BEGINAREA command, followed by overlayable
 libraries in the overlay area between the BEGINAREA and ENDAREA commands.

 Within this area place your own libraries first, then any overlayable third
 party libraries. Finally the non-overlayable compiler libraries, such as
 LLIBCE, should be placed in the root at the end of the script file after the
 ENDAREA command.

 Remember that anything placed between the BEGINAREA and ENDAREA commands
 will be overlaid, and anything above or below will go into the root.
 For example:

 FILE MAIN         # Main in root for performance
 LIB HIGHPRIORITY  # Library of highest priority in root
 LIB ROOT          # Other root libraries
 BEGINAREA         # Start of overlay area
    FILE CODE1     # Overlayable .OBJ
    FILE CODE2     # Overlayable .OBJ
    LIB OTHERLIB   # Overlayable library
    LIB 3RDPARTY   # Overlayable third party library
 ENDAREA           # End of overlay area
 LIB LANGLIB       # Language library in root

 Please note:

 Blinker has no need for any overlay manager files or libraries, they are
 automatically included within the .EXE file at link time.

 Multiple BEGINAREA and ENDAREAs are usually unnecessary because Blinker
 treats code as either overlaid or non-overlaid. In the following CA-Clipper
 5.x example, the overlayable USERLIB calls functions in the non-overlayable
 XXX.LIB, which in turn replaces functions in the overlayable EXTEND.LIB. To
 maintain this order of priority among these libraries (USERLIB first,
 XXX.LIB second and EXTEND.LIB last), multiple BEGINAREA / ENDAREA sections
 are useful.

 OUTPUT MAIN
 FILE MAIN         # Main routine
 SEARCH ROOTVM     # Root lib allows overlay of FUNCKY.LIB
 BEGINAREA
    FILE USER
    LIB USERLIB    # (1)Overlayable library calling functions in XXX
    LIB FUNCKY52   # Main FUNCKy libraries
    LIB FUNCKYVM
    LIB FUNCKY2C
 ENDAREA
 LIB XXX           # (2)Non-overlayable library replacing functions
                   # in EXTEND, and which must go in the root
 BEGINAREA
    LIB EXTEND     # (3) EXTEND comes after it and is overlaid
 ENDAREA
 LIB CLIPPER       # CLIPPER in the root

 Some libraries require that a special root library be included, e.g.
 ROOTVM.LIB for FUNCky. Some also require that a particular .OBJ remain in
 the root. In many cases, only the later versions of the libraries are
 overlayable, so please confirm with the library vendor that the version you
 are using can be overlaid, and also clarify any other stipulations regarding
 usage.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson