Home | Overview | How Do I | Linker Options
/IMPORT:[symbol][,][LIB=container][,WEAK=1]
/IMPORT:[CURRENTVER=#][,][OLDCODEVER=#][,][OLDAPIVER=#]
The /IMPORT option is specific for MACOS. You can use it to specify a function to be imported from a shared library or to specify compatible version numbers for a shared library.
Use the following syntax to import a shared library:
/IMPORT:[function][,][LIB=container][,WEAK=1]
In this syntax, function represents the name of the function you want to import and container represents the name of the library that contains the function.
By default, the functions and shared libraries must be present when the executable file loads. However, if you use the WEAK=1 qualifier with the /IMPORT option, a function or shared library need not be present when the executable file loads. You can make the function1
function in the CONT.LIB library weakly imported by typing the following:
/IMPORT:function1,LIB=CONT.LIB,WEAK=1
You can make the shared library CONT.LIB weakly imported by typing this:
/IMPORT:LIB=CONT.LIB,WEAK=1
You can use the following syntax to specify version numbers for a shared library:
/IMPORT: [CURRENTVER=#][,][OLDCODEVER=#][,][OLDAPIVER=#]
Set CURRENTVER to the current version number of the library. Set OLDCODEVER to the oldest version of the library whose code is compatible with the current definition or API. Set OLDAPIVER to the oldest version of the library that has a definition or API compatible with the current code. To set the current version to 5, the oldest code version to 4, and the oldest API version to 2, type the following:
/IMPORT:CURRENTVER=5,OLDCODEVER=4,OLDAPIVER=2