📄 wlbmain.gml
字号:
For each external symbol in the specified Dynamic Link Library, a
special object module is created that identifies the external symbol
and the actual name of the Dynamic Link Library it is defined in.
This object module is then added to the specified library.
The resulting library is called an import library.
.np
Note that you must specify the "dll" file extension.
Otherwise, the &libname will assume you are adding an object file.
.*
.section Creating Import Library Entries
.*
.np
.ix 'Dynamic Link Library' 'imports'
.ix 'import library'
An import library entry can be created and added to a library by
specifying a command of the following form.
.im wlbimp
.np
.exam begin
&libcmd math ++__sin.trig.sin.1
.exam end
.np
In the above example, an import library entry will be created for symbol
.id sin
and added to the library "math.lib".
The symbol
.id sin
is defined
in the Dynamic Link Library called "trig.dll" as
.id __sin.
When an application is linked with the library "math.lib",
the resulting executable file will contain an import by ordinal value 1.
If the ordinal value was omitted, the resulting executable file would
contain an import by name
.id sin.
.do end
.*
.section Commands from a File or Environment Variable
.*
.np
.ix '&libcmdup' 'command file'
.ix 'LBC command file'
The &libname can be instructed to process all commands in a disk file
or environment variable by specifying the
.bd @name
command where
.bd name
is a file specification for the command file or the name of an
environment variable.
A file extension of "lbc" is assumed for files if none is specified.
The commands must be one of those previously described.
.exam begin
&libcmd mylib @mycmd
.exam end
.pc
In the above example, all commands in the environment variable "mycmd"
or file "mycmd.lbc" are processed by the &libname..
.*
.section &libname Options
.*
.np
.ix '&libcmdup options'
The following sections describe the list of options allowed when
invoking the &libname..
.*
.beglevel
.*
.section Suppress Creation of Backup File - "b" Option
.*
.np
.ix '&libcmdup options ' 'b'
The "b" option tells the &libname to not create a backup library file.
In the following example, the object file identified by "new" will be added
to the library file "mylib.lib".
.exam begin
&libcmd -b mylib +new
.exam end
.pc
If the library file "mylib.lib" already exits, no backup library file
("mylib.bak") will be created.
.*
.section Case Sensitive Symbol Names - "c" Option
.*
.np
.ix '&libcmdup options ' 'c'
The "c" option tells the &libname to use a case sensitive compare
when comparing a symbol to be added to the library to a symbol
already in the library file.
This will cause the names "myrtn" and "MYRTN" to be treated as different
symbols.
By default, comparisons are case insensitive.
That is the symbol "myrtn" is the same as the symbol "MYRTN".
.*
.section Specify Output Directory - "d" Option
.*
.np
.ix '&libcmdup options ' 'd'
The "d" option tells the &libname the directory in which all extracted
modules are to be placed.
The default is to place all extracted modules in the current directory.
.np
In the following example, the module "mymod" is extracted from the library
"mylib.lib".
.if '&target' eq 'QNX' .do begin
The module will be placed in the file "/o/mymod.o".
.do end
.el .do begin
If you are running a DOS, OS/2 or Windows-hosted version of the
&libname, the module will be placed in the file "\obj\mymod.obj".
If you are running a UNIX-hosted version of the &libname, the module
will be placed in the file "/o/mymod.o".
.do end
.exam begin
.if '&target' eq 'QNX' .do begin
&libcmd -d=/o mymod
.do end
.el .do begin
&libcmd -d=\obj mymod DOS, OS/2 or Windows-hosted
or
&libcmd -d=/o mymod UNIX-hosted
.do end
.exam end
.*
.section Specify Output Format - "f" Option
.*
.np
.ix '&libcmdup options ' 'f'
The "f" option tells the &libname the format of the output library.
The default output format is determined by the type of object files
that are added to the library when it is created.
The possible output format options are:
.begnote
.note fa
output AR format library
.note fm
output MLIB format library
.note fo
output OMF format library
.endnote
.*
.section Generating Imports - "i" Option
.*
.np
.ix '&libcmdup options ' 'i'
.ix 'import library'
.ix 'library' 'import'
The "i" option can be used to describe type of import library to
create.
.begnote
.note ia
generate AXP import records
.note ii
generate X86 import records
.note ip
generate PPC import records
.note ie
generate ELF import records
.note ic
generate COFF import records
.note io
generate OMF import records
.endnote
.np
.ix 'Dynamic Link Library' 'imports'
When creating import libraries from Dynamic Link Libraries, import
entries for the names in the resident and non-resident names tables
are created.
The "i" option can be used to describe the method used to import these
names.
.begnote
.note iro
Specifying "iro" causes imports for names in the resident names table
to be imported by ordinal.
.note irn
Specifying "irn" causes imports for names in the resident names table
to be imported by name.
This is the default.
.note ino
Specifying "ino" causes imports for names in the non-resident names
table to be imported by ordinal.
This is the default.
.note inn
Specifying "inn" causes imports for names in the non-resident names
table to be imported by name.
.endnote
.exam begin
&libcmd -iro -inn implib +dynamic.dll
.exam end
.np
Note that you must specify the "dll" file extension for the Dynamic Link
Library.
Otherwise an object file will be assumed.
.*
.section Creating a Listing File - "l" Option
.*
.np
.ix '&libcmdup options ' 'l (lower case L)'
The "l" (lower case "L") option instructs the &libname to produce a
list of the names of all symbols that can be found in the library file
to a listing file.
The file name of the listing file is the same as the file name of the
library file.
The file extension of the listing file is "lst".
.exam begin
&libcmd -l mylib
.exam end
.pc
In the above example, the &libname is instructed to list the contents
of the library file "mylib.lib" and produce the output to a listing
file called "mylib.lst".
.np
An alternate form of this option is
.mono -l=list_file.
With this form, you can specify the name of the listing file.
When specifying a listing file name, a file extension of "lst" is
assumed if none is specified.
.exam begin
&libcmd -l=mylib.out mylib
.exam end
.pc
In the above example, the &libname is instructed to list the contents
of the library file "mylib.lib" and produce the output to a listing file
called "mylib.out".
.np
You can get a listing of the contents of a library file to the terminal
by specifying
only the library name on the command line as demonstrated by the
following example.
.exam begin
&libcmd mylib
.exam end
.*
.section Display C++ Mangled Names - "m" Option
.*
.np
.ix '&libcmdup options ' 'm'
The "m" option instructs the &libname to display C++ mangled names
rather than displaying their demangled form.
The default is to interpret mangled C++ names and display them in
a somewhat more intelligible form.
.*
.section Always Create a New Library - "n" Option
.*
.np
.ix '&libcmdup options ' 'n'
The "n" option tells the &libname to always create a new library file.
If the library file already exists, a backup copy is made
(unless the "b" option was specified).
The original contents of the library are discarded and a new library is
created.
If the "n" option was not specified, the existing library would be updated.
.exam begin
&libcmd -n mylib +myobj
.exam end
.np
In the above example, a library file called "mylib.lib" is created.
It will contain a single object module, namely "myobj", regardless of
the contents of "mylib.lib" prior to issuing the above command.
If "mylib.lib" already exists, it will be renamed to "mylib.bak".
.*
.section Specifying an Output File Name - "o" Option
.*
.np
.ix '&libcmdup options ' 'o'
The "o" option can be used to specify the output library file name if
you want the original library to remain unchanged and a new library
created.
.exam begin
&libcmd -o=newlib lib1 +lib2.lib
.exam end
.pc
In the above example, the modules from "lib1.lib" and
"lib2.lib" are added to the library "newlib.lib".
Note that since the original library remains unchanged, no backup copy
is created.
Also, if the "l" option is used to specify a listing file, the listing
file will assume the file name of the output library.
.*
.section Specifying a Library Record Size - "p" Option
.*
.np
.ix '&libcmdup options ' 'p'
The "p" option specifies the record size in bytes for each record
in the library file.
The record size must be a power of 2 and in the range 16 to 32768.
If the record size is less than 16, it will be rounded up to 16.
If the record size is greater than 16 and not a power of 2, it will be
rounded up to the nearest power of 2.
The default record size is 256 bytes.
.np
Each entry in the dictionary of a library file contains an offset from the
start of the file which points to a module.
The offset is 16 bits and is a multiple of the record size.
Since the default record size is 256, the maximum size of a library file
for a record size of 256 is 256*64K.
If the size of the library file increases beyond this size, you must
increase the record size.
.exam begin
&libcmd -p=512 lib1 +lib2.lib
.exam end
.pc
In the above example, the &libname is instructed to create/update
the library file "lib1.lib" by adding the modules from the library
file "lib2.lib".
The record size of the resulting library file is 512 bytes.
.*
.section Operate Quietly - "q" Option
.*
.np
.ix '&libcmdup options ' 'q'
The "q" option suppressing the banner and copyright notice that is normally
displayed when the &libname is invoked.
.exam begin
&libcmd -q -l mylib
.exam end
.*
.section Strip Line Number Records - "s" Option
.*
.np
.ix '&libcmdup options ' 's'
The "s" option tells the &libname to remove line number records from
object files that are being added to a library.
.if '&prodname' = 'WATFOR-77' .do begin
Line number records are not generated by &prodname.
This option is useful if you are using object files generated by another
compiler that does generate line number records.
.do end
.el .do begin
Line number records are generated in the object file if the "d1" option
is specified when compiling the source code.
.do end
.exam begin
&libcmd -s mylib +myobj
.exam end
.*
.section Trim Module Name - "t" Option
.*
.np
.ix '&libcmdup options ' 't'
The "t" option tells the &libname to remove path information from the module
name specified in THEADR records in object files that are being added to a
library.
The module name is created from the file name by the compiler and placed
in the THEADR record of the object file.
The module name will contain path information if the file name given to the
compiler contains path information.
.exam begin
&libcmd -t mylib +myobj
.exam end
.*
.section Operate Verbosely - "v" Option
.*
.np
.ix '&libcmdup options ' 'v'
The "v" option enables the display of the banner and copyright notice
when the &libname is invoked.
.exam begin
&libcmd -v -l mylib
.exam end
.*
.section Explode Library File - "x" Option
.*
.np
.ix '&libcmdup options ' 'x'
The "x" option tells the &libname to extract all modules from the library.
Note that the modules are not deleted from the library.
Object modules will be placed in the current directory unless the
"d" option is used to specify an alternate directory.
.np
In the following example all modules will be extracted from the library
"mylib.lib" and placed in the current directory.
.exam begin
&libcmd -x mylib
.exam end
.np
In the following example, all modules will be extracted from the library
"mylib.lib".
.if '&target' eq 'QNX' .do begin
The module will be placed in the file "/o" directory.
.do end
.el .do begin
If you are running a DOS, OS/2 or Windows-hosted version of the
&libname, the module will be placed in the "\obj" directory.
If you are running a UNIX-hosted version of the &libname, the module
will be placed in the file "/o" directory.
.do end
.exam begin
.if '&target' eq 'QNX' .do begin
&libcmd -x -d=/o mylib
.do end
.el .do begin
&libcmd -x -d=\obj mylib DOS, OS/2 or Windows-hosted
or
&libcmd -x -d=/o mylib UNIX-hosted
.do end
.exam end
.endlevel
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -