Managing Libraries

The LD_LIBRARY_PATH environment variable contains a semicolon-separated list of directories in which the linker will search for library (.a) files. If you want the linker to search additional libraries, you can add their names to the command line, to a response file, or to the configuration file. In each case, the names of these libraries are passed to the linker before the names of the Intel libraries that the driver always specifies. For more information on adding library names to the response file and the configuration file, see Response Files and Configuration Files.

To specify a library name on the command line, you must first add the library's path to the LIB environment variable. Then, to compile file.cpp and link it with the library mylib.a, enter the following command:

The compiler passes file names to the linker in the following order:

  1. the object file

  2. any objects or libraries specified on the command line, in a response file, or in a configuration file

  3. the libimf.a library