Top Up Prev Next Bottom Contents Index Search

8.3 Linker public members

static void init(const char* execName); 
This function initializes the linker module by telling it where the executable for this program is. For most purposes, passing it the value of argv[0] passed to the main function will suffice.

static int linkObj(const char* objName); 
Link in a single object module using the temporary link mechanism (this entry point is provided for backward compatibility).

static int multiLink(const char* args, int permanent); 
static int multiLink(int argc, char** argv);
Both of these functions give access to the main function for doing an incremental link. They permit either a temporary or a permanent link of multiple files; flags to the Unix linker such as -l to specify a library or -L to specify a search directory for libraries are permitted. For the first form, args are passed as part of a linker command that is expanded by the Unix shell. A permanent link is performed if permanent is true (nonzero); otherwise a temporary link is performed. The second form is provided for ease of interfacing to the Tcl interpreter, which likes to pass arguments to commands in this style. In this case, argv[0] indicates the type of link: if it begins with the character p, a permanent link is performed; otherwise a temporary link is performed. The remaining arguments are concatenated (separated by spaces) and appear in the argument to the Unix linker.

static int isActive(); 
This function returns TRUE if the linker is currently active (so objects can be marked as dynamically linked by the known list classes). Actually the flag it returns is set while constructors or other functions that have just been linked are being run.

static int enabled(); 
Returns true if the linker is enabled (it is enabled by calling Linker::init if that function returns successfully). On platforms that do not support dynamic linking, this function always returns false (zero).

static const char* imageFileName(); 
Return the fully-expanded name of the executable image file (set by Linker::init).

static void setDefaultOpts(const char* newValue);
static const char* defaultOpts();
These functions set or return the linker's default options, a set of flags appended to the end of the command line by all links.



Top Up Prev Next Bottom Contents Index Search

Copyright © 1990-1997, University of California. All rights reserved.