Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Static linkage of a C, C++ or COBOL program

&pagelevel(4)&pagelevel

Static linkage with BINDER

  1. C or COBOL program (object module or link-and-load module)

    /START-BINDER
    //START-LLM-CREATION INT-NAME=internal-name ------------------------ (1)
    //INCLUDE-MODULES LIB=..., ELEM=... -------------------------------- (2)
    //RESOLVE-BY-AUTOLINK LIB=userlibrary ------------------------------ (3)
    //RESOLVE-BY-AUTOLINK LIB=$.SYSLNK.CRTE ---------------------------- (4)
    //SAVE-LLM LIB=..., ELEM=... --------------------------------------- (5)
    //END
    

    (1)

    A link-and-load module with the name internal-name is generated.

    (2)

    The program modules are explicitly included.

    (3)

    The user library userlibrary is statically linked using the Autolink function.

    (4)

    The library $.SYSLNK.CRTE which, among other things, contains the complete C and COBOL runtime system, is statically linked with the Autolink function.

    (5)

    The generated, current link-and-load module is saved.

  2. C++-Program, Cfront mode (link-and-load module) for compiler versions <= V2.2

    /START-BINDER 
    //START-LLM-CREATION INT-NAME=internal-name ------------------------ (1)
    //INCLUDE-MODULES LIB=..., ELEM=... -------------------------------- (2)
    //RESOLVE-BY-AUTOLINK LIB=userlibrary ------------------------------ (3)
    //RESOLVE-BY-AUTOLINK LIB=($.SYSLNK.CRTE,$.SYSLNK.CRTE.CPP) -------- (4)
    //SAVE-LLM LIB=..., ELEM=... --------------------------------------- (5)
    //END
    

    (1)

    A link-and-load module with the name internal-name is generated.

    (2)

    The program modules are explicitly included.

    (3)

    The user library userlibrary is statically linked using the Autolink function.

    (1)

    A link-and-load module with the name internal-name is generated.

    (2)

    The program modules are explicitly included.

    (3)

    The user library userlibrary is statically linked using the Autolink function.

    (4)

    The following are also statically linked with the Autolink function:

    (5)

    The current link-and-load module is saved.

  3. Cfront C++ program (link-and-load module) for compiler versions as of V3.0

    /START-CPLUS-COMPILER ----------------------------------------------- (1)
    //MODIFY-BIND-PROPERTIES INCLUDE=*LIB(LIB=...,ELEM=...) 
    //MODIFY-BIND-PROPERTIES RESOLVE=*AUTOLINK(userlibrary)
    //MODIFY-BIND-PROPERTIES RUNTIME-LANG=CPLUSPLUS(CPP),STDLIB=STATIC
    //BIND OUTPUT=*LIB(LIB=...,ELEM=...)
    

    (1)

    The linkage editor is implicitly called by the C++ compiler.The following statements for the C++ compiler have the same functionality as the BINDER statements in Example 2.