Name an Alternate Library Directory (C6X_C_DIR Environment Variable)

An environment variable is a system symbol that you define and assign a string to. The linker uses an environment variable named C6X_C_DIR to name alternate directories that contain object libraries. The command syntaxes for assigning the environment variable are:

Operating System Enter
UNIX (Bourne shell) C6X_C_DIR="pathname1;pathname2; . . ."; export C6X_C_DIR
Windows set C6X_C_DIR= pathname1;pathname2; . . .

The pathnames are directories that contain input files. Use the --library linker option on the command line or in a command file to tell the linker which library or linker command file to search for. The pathnames must follow these constraints:

In the example below, assume that two archive libraries called r.lib and lib2.lib reside in ld and ld2 directories. The table below shows how to set the environment variable, and how to use both libraries during a link. Select the row for your operating system:

Operating System Invocation Command
UNIX (Bourne shell) C6X_C_DIR="/ld ;/ld2"; export C6X_C_DIR;
cl6x --run linker f1.obj f2.obj --library=r.lib --library=lib2.lib
Windows C6X_C_DIR=\ld;\ld2
cl6x --run linker f1.obj f2.obj --library=r.lib --library=lib2.lib

The environment variable remains set until you reboot the system or reset the variable by entering:

Operating System Enter
UNIX (Bourne shell) unset C6X_C_DIR
Windows set C6X_C_DIR=

The assembler uses an environment variable named C6X_A_DIR to name alternate directories that contain copy/include files or macro libraries. If C6X_C_DIR is not set, the linker searches for object libraries in the directories named with C6X_A_DIR. For information about C6X_A_DIR, see Section 4.5.2. For more information about object libraries, see Section 8.6.3.