Linking your programs

When you want to link your program execute the Link command fromthe Build Menu. The environment will always compile any files as necessary beforelinking your program if necessary. In other words, once you have added your modulesto the project the environment handles all aspects of building an executable foryou automatically and transparently.

Program Stack size

For those targets which allow you to specify a stack size fora program, the stack size given the program is specified in one of two ways. Thedefault stack size or a specific stack size for a given program module. The defaultstack size is specified in the Project Options dialog. The specific stack size fora program module is specified in the Module menu. If a program module has a stacksize of zero, the default, then the default stack size is used.

Normally you would use the Run or Debug commands from the BuildMenu which will link your program when necessary.

External object libraries and shared object files are automaticallylinked to programs via the LIBNEEDED compilerdirective. If a module with this directive is a part of a program then the librarywill be linked into the program. Additional information can be found in the Usingthird party libraries in OBJ or LIB form topic.

Resource files are automatically linked similarly via the RESOURCEcompiler directive.

The LIBNEEDED and RESOURCE directives act as an import declarationof sorts. As such the directives must be in the imports area of  the sourcefile. The compiler ignores these directives, however the environment uses them toautomatically link the listed file as necessary. The file is included in the linkif the source file containing the directive is a part of the program being linked.If a source file has more than one LIBNEEDED directive then the libraries will belinked in the order of directives in the source file.