link

Description

This is not a task in itself, but a base inherited by the following four tasks:

linkstaticlibrary
Link a standard static library which can be linked statically with an executable. (configured using staticlibrarylinker)
linkdynamiclibrary
Link a standard dynamic library which can be linked with an executable and get automatically loaded and linked when the executable is started. Libraries linked with this task cannot be used as loadable modules on all platforms! (configured using dynamiclibrarylinker)
linkloadablemodule
Link a loadable module, which can be loaded (and unloaded) dynamically at runtime. This is called a bundle on some platforms (osx). A loadable module may itself depend on other static or dynamic libraries.(configured using loadablemodulelinker)
linkexecutable
Link a normal executable with static libraries and object files. (configured using executablelinker)
The linkers will only link, which means .o-files or other libarries are the base which they operate on. To compile c++ into object files, use the compile task.

The following parameters are common for all link tasks.

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"
os
Override the detected OS to use another linker definition. This might be handy when using different compiler suites on the same machine and build script.
No. Default:  detected OS name

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 obj7ect files to link into the library file.. It can be accessed using an arglist with the name="objfiles".

Examples

None.