2025-12-16 10:20:31 -07:00
|
|
|
# lib
|
|
|
|
|
|
|
|
|
|
> The Microsoft Library Manager for creating and managing static libraries of object files.
|
|
|
|
|
> More information: <https://learn.microsoft.com/cpp/build/reference/lib-reference>.
|
|
|
|
|
|
|
|
|
|
- Create a static library from object files:
|
|
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
`lib /OUT :{{path\to\library.lib}} {{path\to\file1.obj path\to\file2.obj ...}}`
|
2025-12-16 10:20:31 -07:00
|
|
|
|
|
|
|
|
- List the contents of a library:
|
|
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
`lib /LIST {{path\to\library.lib}}`
|
2025-12-16 10:20:31 -07:00
|
|
|
|
|
|
|
|
- Add an object file to an existing library:
|
|
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
`lib {{path\to\library.lib}} {{path\to\file.obj}}`
|
2025-12-16 10:20:31 -07:00
|
|
|
|
|
|
|
|
- Remove an object file from a library:
|
|
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
`lib /REMOVE :{{path\to\file.obj}} {{path\to\library.lib}}`
|
2025-12-16 10:20:31 -07:00
|
|
|
|
|
|
|
|
- Extract an object file from a library:
|
|
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
`lib /EXTRACT :{{path\to\file.obj}} {{path\to\library.lib}}`
|
2025-12-16 10:20:31 -07:00
|
|
|
|
|
|
|
|
- Create an import library from a DLL:
|
|
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
`lib /DEF :{{path\to\definition.def}} /OUT:{{path\to\import.lib}}`
|