妖哥或各位老大,进来一下啊,怎么使用TLIB.EXE 呢?

WYJBCB 2010-07-19 03:20:57
CB的全英文教程说的不太清楚,有没有人举个例子呢?谢谢

有a.lib ,b.lib c.lib几个文件,想通过TLIB.EXE 把b.lib c.lib合并到a.lib里,不知怎么使用?

TLIB.EXE a.lib+b.lib+c.lib aa.lst 这样子不行啊。 为什么呢?英文又不是很好
...全文
383 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
xiaosi2468 2011-04-26
  • 打赏
  • 举报
回复
终于知道 原来 tc 如此强大
china_west 2010-08-03
  • 打赏
  • 举报
回复
project->add to project

头文件加xx.h
houleiyang 2010-08-02
  • 打赏
  • 举报
回复
妖哥威武!!!!三十年大哥,我想死的心都有了~!
WYJBCB 2010-07-19
  • 打赏
  • 举报
回复
现在问题是这样子

我实现了一个对外公布的lib, 但这个lib用到了其它几个lib.

现在,发布这个lib时,还必须包含用到的几个lib,领导们说不好,
有没有办法可以将几个lib合成一个啊?
ccrun.com 2010-07-19
  • 打赏
  • 举报
回复
我不懂电脑 2010-07-19
  • 打赏
  • 举报
回复
/x
Extract the module and remove it.








[edit] TLIB Operations List
The operation list describes the actions you want TLIB to do and consists of a sequence of operations given one after the other. Each operation consists of a one- or two-character action symbol followed by a file or module name.:

<symbol> modulename
You can put whitespace around either the action symbol or the file or module name, but not in the middle of a two-character action or in a name. You can put as many operations as you like on the command line, up to DOS's COMMAND.COM-imposed line-length limit of 127 characters. The order of the operations is not important. TLIB always applies the operations in a specific order:

To replace a module, remove it, then add the replacement module.

All extract operations are done first.
All remove operations are done next.
All add operations are done last.
TLIB finds the name of a module by stripping any drive, path, and extension information from the given file name.

Note that TLIB always assumes reasonable defaults. For example, to add a module that has an .OBJ extension from the current directory, you need to supply only the module name, not the path and .OBJ extension.

Wildcards are never allowed in file or module names.

TLIB recognizes three action symbols (*, +, -), which you can use singly or combined in pairs for a total of five distinct operations. The order of the characters is not important for operations that use a pair of characters.

To create a library, you add modules to a library that does not yet exist.

TLIB Action Symbols:

Symbol Name Description
+
Add
TLIB adds the named file to the library. If the file has no extension, TLIB assumes an extension of .OBJ. If the file is itself a library (with a .LIB extension), then the operation adds all of the modules in the named library to the target library.If a module being added already exists, TLIB displays a message and does not add the new module.

-
Remove
TLIB removes the named module from the library. If the module does not exist in the library, TLIB displays a message.A remove operation needs only a module name. TLIB lets you enter a full path name with drive and extension included, but ignores everything except the module name.

*
Extract
TLIB creates the named file by copying the corresponding module from the library to the file. If the module does not exist, TLIB displays a message and does not create a file. If the named file already exists, it is overwritten.You can't directly rename modules in a library. To rename a module, extract and remove it, rename the file just created, then add it back into the library.

-* or *-
Extract and remove
TLIB copies the named module from the library to the file. If the module does not exist, TLIB displays a message and does not create a file. If the named file already exists, it is overwritten. TLIB removes the file name and then removes it from the library.

-+ or +-
Replace
TLIB replaces the named module with the corresponding file.








[edit] Using TLIB Response Files
A response file is an ASCII text file that contains all or part of a TLIB command. Using TLIB response files, you can build TLIB commands that are longer than one command line. If you need to perform a large number of operations or perform operations several times, response files can make your job easier.

Response files can:

Contain more than one line of text; use the ampersand character (&) at the end of a line to indicate that another line follows.
Include a partial list of commands. You can combine options from the the command line with options in a response file.
Be used with other response files in a single TLIB command line.
[edit] TLIB Examples
These simple examples demonstrate some of the different things you can do with TLIB:

Example 1

To create a library named MYLIB.LIB with modules X.OBJ, Y.OBJ, and Z.OBJ, type:

tlib mylib +x +y +z
Example 2

To create a library named MYLIB.LIB and get a listing in MYLIB.LST too, type:

tlib mylib +x +y +z, mylib.lst
Example 3

To get a listing in CS.LST of an existing library CS.LIB, type:

tlib cs, cs.lst
Example 4

To replace module X.OBJ with a new copy, add A.OBJ and delete Z.OBJ from MYLIB.LIB, type:

tlib mylib -+x +a -z
Example 5

To extract module Y.OBJ from MYLIB.LIB and get a listing in MYLIB.LST, type:

tlib mylib *y, mylib.lst
Example 6

To create a new library named ALPHA, with modules A.OBJ, B.OBJ, ..., G.OBJ using a response file:

First create a text file, ALPHA.RSP, with:+a.obj +b.obj +c.obj & +d.obj +e.obj +f.obj & +g.obj
Then use the TLIB command, which produces a listing file named ALPHA.LST: tlib alpha @alpha.rsp, alpha.lst
Example 7

To update modules Y.OBJ and Z.OBJ and delete modules A.OBJ and B.OBJ from MYLIB.LIB:

tlib mylib /u Y.obj Z.obj /d A.obj B.obj
我不懂电脑 2010-07-19
  • 打赏
  • 举报
回复
TLIB.EXE, the Library ManagerFrom RAD Studio
Go Up to Command Line Utilities Index





TLIB is a utility that manages libraries of .OBJ (object module) files. A library is a convenient way to deal with a collection of object modules as a unit.

The libraries included with the C++Builder C++ compiler were built with TLIB. You can use TLIB to build your own libraries, or to modify the C++Builder C++ libraries, your libraries, libraries furnished by other programmers, or commercial libraries you've purchased.

When TLIB modifies an existing library, TLIB creates a copy of the original library and gives it a .BAK extension.

You can use TLIB to:

Create a new library from a group of object modules.
Add object modules or other libraries to an existing library.
Remove object modules from an existing library.
Replace object modules from an existing library.
Extract object modules from an existing library.
List the contents of a new or existing library.
TLIB can also create (and include in the library file) an extended dictionary, which can be used to speed up linking.

Although TLIB is not essential for creating executable programs with the C++Builder C++ compiler, it is a useful programming productivity tool that can be indispensable for large development projects.

Contents
1 Command Line Syntax 2 TLIB General Command Options 2.1 TLIB /C Option: Using Case-Sensitive Symbols in a Library 2.2 TLIB /P option: Setting the Page Size to Create a Large Library 3 TLIB Default Action Options 4 TLIB Operations List 5 Using TLIB Response Files 6 TLIB Examples

[edit] Command Line Syntax
TLIB <libname> [<options>] [<operations>] [@<respfile>] [, <listfile>]

To display command line help, enter:

C:\>tlib
Element Description
<libname>
The DOS path name of the library you want to create or manage. Every TLIB command must be given a libname. Wildcards are not allowed. TLIB assumes an extension of .LIB if none is given. Use only the .LIB extension because both BCC32 and the IDE require the .LIB extension in order to recognize library files. Note: If the named library does not exist and there are add operations, TLIB creates the library.

<options>
TLIB accepts five general options (C, L, P, O, and 8) as well as five default action options (a, d, e, u, and x). See the headings immediately following this table for details about the TLIB <options> and about the default action options.

<operations>
Describes the actions you want TLIB to do and consists of a sequence of two-character operation codes. If you only want to examine the contents of the library, do not give any operations. For more information, see the heading later in this topic.

@<respfile>
The path and name of the response file you want to include. You can specify more than one response file. For more details, see the heading later in this topic.

<listfile>
The name of the text file that TLIB will produce to hold a listing of the library contents. The listfile name (if given), must be preceded by a comma. No listing is produced if you don't give a file name. The listing is an alphabetical list of each module. The entry for each module contains an alphabetical list of each public symbol defined in that module. The default extension for the listfile is .LST.


[edit] TLIB General Command Options
TLIB recognizes seven general command <options>:

/C (case-sensitive; see further information below)
/L (produces a listing file on standard output)
/N (disables the default action options)
/O (capital-o; enables the default action options)
/P (page size; see further information below)
/0 (zero; purges comment records)
/8 (displays warnings and messages encoded as UTF8)
Several of these options are described in more detail in this section.

[edit] TLIB /C Option: Using Case-Sensitive Symbols in a Library
When you add a module to a library, TLIB maintains a dictionary of all public symbols defined in the modules of the library. All symbols in the library must be distinct. If you try to add a module to the library that duplicates a symbol, TLIB displays an error message and doesn't add the module.

Normally, when TLIB checks for duplicate symbols in the library, uppercase and lowercase letters are not treated differently (for example, the symbols lookup and LOOKUP are treated as duplicates). You can use the /C option to add a module to a library that includes symbols differing only in case.

Don't use /C if you plan to use the library with other linkers or let other people use the library.

TLIB normally rejects symbols that differ only in case because some linkers aren't case-sensitive. ILINK32 has no problem distinguishing uppercase and lowercase symbols. As long as you use your library only with ILINK32, you can use the TLIB /C option without any problems.

[edit] TLIB /P option: Setting the Page Size to Create a Large Library
The library page size determines the maximum combined size of all object modules in the library, which cannot exceed 65,536 pages. The default (and minimum) page size of 16 bytes allows a library of about 1 MB in size. To create a larger library, use the /P option to increase the page size. The page size must be a power of 2, and it cannot be smaller than 16 or larger than 32,768.

All modules in the library must start on a page boundary. For example, in a library with a page size of 32 (the lowest possible page size higher than the default 16), an average of 16 bytes will be lost per object module in padding. If you attempt to create a library that is too large for the given page size, TLIB will issue an error message and suggest that you use /P with the next available higher page size.

[edit] TLIB Default Action Options
The default action options allow you to specify an action or several actions that are used for every subsequent module that does not have an explicit command specified, or until a different action flag is set. Using the default action options enables you to specify modules in a TLIB command without having to prefix each module with a command or action symbol. The TLIB default action options perform actions similar to those performed by the TLIB operation flags described in TLIB Operations List.

TLIB Default Action Options:

Symbol Description
/a
Add the module to the library.

/d
Remove the module from the library.

/e
Extract the module without removing it.

/u
Replace the module in the library.

YeBinYe 2010-07-19
  • 打赏
  • 举报
回复
其实,一个lib文件是obj文件的集合。当然,其中还夹杂着其他一些辅助信息,目的是为了让编译器能够准确找到对应的obj文件。我们可以通过tlib.exe(在tc2.0下的根目录)来对lib文件进行操作,你可以把自己生成的obj文件通过tlib命令加入到一个lib文件中,也可以把lib文件内的obj文件进行删除操作,还可以把内部的obj文件给提取出来。明白了lib文件的大致结构以及对它的具体操作,在学习C语言的过程中,就会又多了一个切入点对C语言具体实现进行研究。
  在command下,把当前目录设置为tlib.exe所在目录,然后输入tlib命令回车,此时显示的内容就是对tlib命令的详细解释,语法如下:
Syntax: TLIB libname [/C] [/E] commands, listfile
libname library file pathname
commands sequence of operations to be performed (optional)
listfile file name for listing file (optional)
A command is of the form: <symbol>modulename, where <symbol> is:
+ add modulename to the library
- remove modulename from the library
* extract modulename without removing it
-+ or +- replace modulename in library
-* or *- extract modulename and remove it
/C case-sensitive library
/E create extended dictionary
具体解释:
tlib libname [/C] [/E] commands, listfile
/C:大小写敏感标志。该选项不常用,此参数为可选项。
/E:建立扩展字典。建立扩展字典可以加速大的库文件的连接过程,此参数同样为可选项。
操作命令(可选项):
+ obj文件名 把指定obj文件添加到lib文件中
- obj文件名 把指定obj文件从lib文件中删除
* obj文件名 导出指定的obj文件(导出后对应的obj文件在lib文件内仍然存在)
-+ obj文件名 替换指定的obj文件(前提是在lib文件中存在与指定obj文件同名的obj)
-* obj文件名 导出指定的obj文件(导出后把对应的obj文件从lib文件内删除)
lib文件中obj文件列表(可选项)
此参数说明了命令运行后,生成的对应lib文件的列表文件名。它记录了当前lib文件内obj文件列表。如果你新加入了一个obj文件,就能从生成的lst文件中找到对应的obj文件的名称,至于其它信息的具体含义,自己有时间再去研究。
ccrun.com 2010-07-19
  • 打赏
  • 举报
回复
tlib lib文件名 +模块1 + 模块2
Turbo C2.0 介绍   Turbo C2.0不仅是一个快捷、高效的编译程序,同时还有一个易学、易用的集成开发环境。使用Turbo C2.0无需独立地编辑、编译和连接程序,就能建立并运行C语言程序。因为这些功能都组合在Turbo 2.0的集成开发环境内,并且可以通过一个简单的主屏幕使用这些功能。 基本配置要求   Turbo C 2.0可运行于IBM-PC系列微机,包括XT,AT及IBM 兼容机。此时要求DOS2.0或更高版本支持,并至少需要448K的RAM,可在任何彩、单色80列监视器上运行。支持数学协处理器芯片,也可进行浮点仿真,这将加快程序的执行。 主要文件的简单介绍   INSTALL.EXE 安装程序文件   TC.EXE 集成编译   TCINST.EXE 集成开发环境的配置设置程序   TCHELP.TCH 帮助文件   THELP.COM 读取TCHELP.TCH的驻留程序README 关于Turbo C的信息文件   TCCONFIG.EXE 配置文件转换程序MAKE.EXE   项目管理工具TCC.EXE   命令行编译TLINK.EXE   Turbo C系列连接器TLIB.EXE   Turbo C系列库管理工具C0?.OBJ 不   同模式启动代码C?.LIB   不同模式运行库GRAPHICS.LIB   图形库EMU.LIB   8087仿真库FP87.LIB 8087库   *.H Turbo C头文件   *.BGI 不同显示器图形驱动程序   *.C Turbo C例行程序(源文件)   其中:上面的?分别为:T Tiny(微型模式)S Small(小模式)C Compact(紧凑模式)M Medium(中型模式)L Large(大模式)H Huge(巨大模式)
部分内容:  用C 语言编程时,通常要建立一些用户函数。如果这些函数具有通用性,一般的方法是将它们作成头文件,当需要时用“#include”命令将其包含到源程序之中,以提高编程效率。但在特定的程序中一般仅使用这些函数的一部分,若用上述方法包含所有函数,编译器在编译的时候会把所有包含进的函数都进行编译,这无疑会使源程序变得庞大而难于理解,并会影响执行效率。建立用户目标模块库(lib文件)可以解决这个问题,你可以事先把有特定功能的通用的子函数集编译完成后生成的obj文件打入lib文件,当链接器tlink.exe在进行链接操作时,便只会把程序内部用到的通用函数所在的obj文件链接进来(已验证:不能定位到具体函数),这样生成的obj文件便会更精简,生成的exe文件也更小。   其实,一个lib文件是obj文件的集合。当然,其中还夹杂着其他一些辅助信息,目的是为了让编译器能够准确找到对应的obj文件。我们可以通过tlib.exe(在tc2.0下的根目录)来对lib文件进行操作,你可以把自己生成的obj文件通过tlib命令加入到一个lib文件中,也可以把lib文件内的obj文件进行删除操作,还可以把内部的obj文件给提取出来。明白了lib文件的大致结构以及对它的具体操作,在学习C语言的过程中,就会又多了一个切入点对C语言具体实现进行研究。

13,825

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder相关内容讨论区
社区管理员
  • 基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧