共用方式為


LIB Task

Wraps the Microsoft 32-Bit Library Manager tool, lib.exe. The Library Manager creates and manages a library of Common Object File Format (COFF) object files. The Library Manager can also create export files and import libraries to reference exported definitions. For more information, see LIB Reference and Running LIB.

Parameters

The following table describes the parameters of the LIB task. Most task parameters correspond to a command-line option.

Parameter

Description

AdditionalDependencies

Optional String[] parameter.

Specifies additional items to add to the command line.

AdditionalLibraryDirectories

Optional String[] parameter.

Overrides the environment library path. Specify a directory name.

For more information, see /LIBPATH (Additional Libpath).

AdditionalOptions

Optional String parameter.

A list of lib.exe options as specified on the command line. For example, "/option1 /option2 /option#". Use this parameter to specify lib.exe options that are not represented by any other LIB task parameter.

For more information, see Running LIB.

DisplayLibrary

Optional String parameter.

Displays information about the output library. Specify a file name to redirect the information to a file. Specify "CON" or nothing to redirect the information to the console.

This parameter corresponds to the /LIST option of lib.exe.

ErrorReporting

Optional String parameter.

Specifies how to send internal error information to Microsoft if lib.exe fails at runtime.

Specify one of the following values, each of which corresponds to a command-line option.

Value

Command-line option

NoErrorReport

/ERRORREPORT:NONE

PromptImmediately

/ERRORREPORT:PROMPT

QueueForNextLogin

/ERRORREPORT:QUEUE

SendErrorReport

/ERRORREPORT:SEND

For more information, see the /ERRORREPORT command-line option at Running LIB.

ExportNamedFunctions

Optional String[] parameter.

Specifies one or more functions to export.

This parameter corresponds to the /EXPORT: option of lib.exe.

ForceSymbolReferences

Optional String parameter.

Forces lib.exe to include a reference to the specified symbol.

This parameter corresponds to the /INCLUDE: option of lib.exe.

IgnoreAllDefaultLibraries

Optional Boolean parameter.

If true, removes all default libraries from the list of libraries that lib.exe searches when it resolves external references.

This parameter corresponds to the parameter-less form of the /NODEFAULTLIB option of lib.exe.

IgnoreSpecificDefaultLibraries

Optional String[] parameter.

Removes the specified libraries from the list of libraries that lib.exe searches when it resolves external references.

This parameter corresponds to the /NODEFAULTLIB option of lib.exe that takes a library argument.

LinkLibraryDependencies

Optional Boolean parameter.

If true, specifies that library outputs from project dependencies are automatically linked in.

LinkTimeCodeGeneration

Optional Boolean parameter.

If true, specifies link-time code generation.

This parameter corresponds to the /LCTG option of lib.exe.

MinimumRequiredVersion

Optional String parameter.

Specifies the minimum required version of the subsystem. Specify a comma-delimited list of decimal numbers in the range 0 through 65535.

ModuleDefinitionFile

Optional String parameter.

Specifies the name of the module-definition file (.def).

This parameter corresponds to the /DEF option of lib.exe that takes a filename argument.

Name

Optional String parameter.

When an import library is built, specifies the name of the DLL for which the import library is being built.

This parameter corresponds to the /NAME option of lib.exe that takes a filename argument.

OutputFile

Optional String parameter.

Overrides the default name and location of the program that lib.exe creates.

This parameter corresponds to the /OUT option of lib.exe that takes a filename argument.

RemoveObjects

Optional String[] parameter.

Omits the specified object from the output library. Lib.exe creates an output library by combining all objects (whether in object files or libraries), and then deleting any objects that are specified by this option.

This parameter corresponds to the /REMOVE option of lib.exe that takes a membername argument.

Sources

Required ITaskItem[] parameter.

Specifies a list of source files separated by spaces.

SubSystem

Optional String parameter.

Specifies the environment for the executable. The choice of subsystem affects the entry point symbol or entry point function.

Specify one of the following values, each of which corresponds to a command-line option.

Value

Command-line option

Console

/SUBSYSTEM:CONSOLE

Windows

/SUBSYSTEM:WINDOWS

Native

/SUBSYSTEM:NATIVE

EFI Application

/SUBSYSTEM:EFI_APPLICATION

EFI Boot Service Driver

/SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER

EFI ROM

/SUBSYSTEM:EFI_ROM

EFI Runtime

/SUBSYSTEM:EFI_RUNTIME_DRIVER

WindowsCE

/SUBSYSTEM:WINDOWSCE

POSIX

/SUBSYSTEM:POSIX

For more information, see /SUBSYSTEM (Specify Subsystem).

SuppressStartupBanner

Optional Boolean parameter.

If true, prevents the display of the copyright and version number message when the task starts.

For more information, see the /NOLOGO option at Running LIB.

TargetMachine

Optional String parameter.

Specifies the target platform for the program or DLL.

Specify one of the following values, each of which corresponds to a command-line option.

Value

Command-line option

MachineARM

/MACHINE:ARM

MachineEBC

/MACHINE:EBC

MachineIA64

/MACHINE:IA64

MachineMIPS

/MACHINE:MIPS

MachineMIPS16

/MACHINE:MIPS16

MachineMIPSFPU

/MACHINE:MIPSFPU

MachineMIPSFPU16

/MACHINE:MIPSFPU16

MachineSH4

/MACHINE:SH4

MachineTHUMB

/MACHINE:THUMB

MachineX64

/MACHINE:X64

MachineX86

/MACHINE:X86

For more information, see /MACHINE (Specify Target Platform).

TrackerLogDirectory

Optional String parameter.

Specifies the directory of the tracker log.

TreatLibWarningAsErrors

Optional Boolean parameter.

If true, causes the LIB task to not generate an output file if lib.exe generates a warning. If false, an output file is generated.

For more information, see the /WX option at Running LIB.

UseUnicodeResponseFiles

Optional Boolean parameter.

If true, instructs the project system to generate UNICODE response files when the librarian is spawned. Specify true when files in the project have UNICODE paths.

Verbose

Optional Boolean parameter.

If true, displays details about the progress of the session; this includes names of the .obj files being added. The information is sent to standard output and can be redirected to a file.

For more information, see the /VERBOSE option in Running LIB.

See Also

Other Resources

MSBuild Task Reference