SLAU131V October 2004 – February 2020
The --search_path option names an alternate directory that contains input files. The --search_path option's short form is -I. The syntax for this option is:
--search_path=pathname
The pathname names a directory that contains input files.
When the linker is searching for input files named with the --library option, it searches through directories named with --search_path first. Each --search_path option specifies only one directory, but you can have several --search_path options per invocation. When you use the --search_path option to name an alternate directory, it must precede any --library option used on the command line or in a command file.
For example, assume that there are two archive libraries called r.lib and lib2.lib that reside in ld and ld2 directories. The table below shows the directories that r.lib and lib2.lib reside in, how to set environment variable, and how to use both libraries during a link. Select the row for your operating system:
Operating System | Enter |
---|---|
UNIX (Bourne shell) |
cl430 --run_linker f1.c.obj f2.c.obj --search_path=/ld --search_path=/ld2
|
Windows |
cl430 --run_linker f1.c.obj f2.c.obj --search_path=\ld --search_path=\ld2
|