linkstaticlibrary

Description

(see the link page for more information about linking)

Link a standard static library which can be linked statically with an executable. (configured using staticlibrarylinker)

Parameters

Attribute Description Required
output The name of the library. A platform specific ending and prefix might be added to this name automatically by the linker where appilcable (for example lib<name>.a<name>.dll, <name>.dylib <name>.lib) No. Default: "a.out"
debug true turns on debugging symbols. false optimizes for release. Exactly what is done is determined by the command sequence defined for this linker. No. Default: "true"

Parameters specified as nested elements

libpath

An ant Path which tells the linker where to find the library files files specified with the lib-element.

staticlibrary

The static libraries to link into the target. This should be just the names without the path since they should be found either among the system library path or the path given by the libpath element. Also leave out the platform specific prefix and suffiixes (typically lib<name>.a or <name>.lib).  It can be accessed using an arglist with the name="staticlibraries".

dynamiclibrary

The dynamic libraries to link with the target. This should be just the names without the path since they should be found either among the system library path or the path given by the libpath element. Also leave out the platform specific prefix and suffiixes (typically lib<name>.dylib or <name>.lib).  It can be accessed using an arglist with the name="dynamiclibraries".

objfiles

An ant FileSet which selects all object files to link into the library file.. It can be accessed using an arglist with the name="objfiles".

Examples

<target name="build-lib" depends="init">
<linkstaticlibrary output="lib/nc5">
<objfiles dir="obj" includes="**/*"/>
</linkstaticlibrary>
</target>

This will link all files in obj/ and place the resulting file in lib/libnc5.a or lib/nc5.lib depending on the platform.