To build a static library, use the following steps:
Here is an excerpt from a configuration file. These directives build a library in a file named mylib.lib from three C++ source files and an object file.
target "mylib.lib" {
source "a.cpp", "a.hpp", "b.cpp"
source "c.obj"
}
When you build a module that links to your library, list the library as a source.
You cannot add or change object modules in a library by specifying the library as both a source and a target of a build.
![]()
You can update a
library, and perform other maintenance tasks on OS/2 and Windows NT platforms
with the library manager, ilib.
However, if you change a library with ilib, the
utility does not update the codestore and subsequent builds may
not have the desired results.
![]()
Creating
a Static Library with ilib
On OS/2 and Windows NT platforms, you can create a new static
library from existing object modules or libraries without
performing a full VisualAge C++ build. Use the ilib command:
For example, the following command creates the library newlib.lib out of objects in abc.obj and mylib.lib. If a library named newlib.lib already exists, it is replaced.
ilib /out:newlib.lib abc.obj mylib.lib
![]()
![]()
Static and Dynamic
Libraries
Configuration Files
Codestore
![]()
Maintaining Libraries
![]()
Change a Build Setup
Add or Change Source
Files
Add or Change Targets
Set Build Options
Build
Build With Existing Object Files and
Libraries
Produce Object Files from a Build
