You should create a static library by building from the IDE or by issuing the vacbld command. A build creates a new library from scratch. Because you cannot specify the same library file as a source and a target in your configuration file, you cannot add functions or variables to an existing library by performing a build.
If you do not want to rebuild an existing library, you can add modules to it using the ilib command. However, if you change a library with ilib, the utility does not update the codestore and subsequent builds may not have the desired results.
To add modules to an existing library, follow these steps:
For example, the following command adds the module sample.obj to the library mylib.lib.
ilib /out:mylib.lib mylib.lib sample
New object modules are given the same name as the base name of the .obj file. If the object module already exists in the library, ilib replaces it.
You can perform several tasks in one run of ilib. For example the following command adds the module cats.obj to the library pets.lib. At the same time it copies the module dogs from the library to the current directory and deletes the module birds from the library.
ilib /out:pets.lib cats.obj /extract:dogs /remove:birds
![]()
Static and Dynamic
Link Libraries
Maintaining Libraries
![]()
List the Contents of a Static Library
Combine Static Libraries
Replace an Object Module in a Static
Library
Extract an Object Module from a Static
Library
Remove an Object Module from a Static
Library
