Important: The information in this document is obsolete and should not be used for new development.
Declare Weak Symbols in Client
If symbols are added to a newer version of an import library, the developer can make sure that the newer clients can still link to the older library by declaring the new symbols to be weak. This method, however, has two drawbacks: the client application must check for all weak imports, and the developer must keep track of all weak exports.For example, say you have a library
mooLib 1.0
, which contains the symbolsdog
andcow
. Later you updatemooLib
to 2.0 by adding the symbolswoof
andmoof
. Ifwoof
andmoof
are declared weak by a client built withmooLib 2.0
, the client can still run withmooLib 1.0
; it just cannot use the symbolswoof
andmoof
.The developer's code must check for the presence of all weak symbols before attempting to use them and perhaps inform the end user of any limited functionality if some symbols are not present. In addition, each time a new version of the library is created, the developer must create a new weak export list. For example, building clients with
mooLib 2.0
requires a weak export list of all symbols added after version 1.0. Building with version 3.0 would require a list of weak symbols added between 1.0 and 2.0 and a list of symbols added between 2.0 and 3.0. When building libraries for other developers, the developer would have to supply an updated export list for every version released.