libSearchPath Link Option

Syntax: Default:
link(libSearchPath, path) link(libSearchPath, "/usr/vacpp/lib")
link(libSearchPath, "")

This option specifies the search path for libraries at the link stage of a VisualAge C++ build.

On AIX, this option also specifies the search path for shared libraries to be loaded at run time. The path specified with this option is stored in the build target. If you set the LIBPATH environment variable, the variable overrides the path specified here.

When VisualAge C++ looks for libraries to link, the search has two distinct stages:

  1. The path controlled by this option is searched first.
    On AIX, the search starts by default in /usr/vacpp/lib.
    On OS/2 and Windows NT platforms, the initial search path is empty.
  2. The default search path is searched last.
    On AIX, the default search path is /usr/lib:/lib.
    On OS/2 and Windows NT platforms the default search path is stored in the LIB environment variable.

The default libSearchPath option path will be searched after any paths you specify using this option, and before the default system search path. 

Multiple search paths can be specified in the following ways:

The following example illustrates the order in which multiple search paths are concatenated:

option link(libsearchpath,"a:b") {
	option link(libsearchpath, "c:d") link(libsearchpath,"e:f") {
        	option link(libsearchpath,"g:h") {
            		source ...
		}
	}
}

The option directives above apply the specified paths to the source in the following order:

g,h,c,d,e,f,a,b

On AIX, you can also specify a prefix for the paths specified with this option by building with option link(libSearchPathPrefix, path). Usually you do this to build on one level of AIX to run on a different level, so that you can search a different path on the development platform than on the target platform. The prefix is not stored in the executable.



Incremental C++ Build
C Compilation
Configuration Files
Linker Searches


Set Build Options
Build


Link Options
Link Options
Application Run-Time Environment Variables