Managing Libraries

The LD_LIBRARY_PATH environment variable contains a colon-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 LD_LIBRARY_PATH, to the command line, or to a response file (see Note). 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.


Response files are processed at the location they appear on the command line.  If libraries are specified in the response file, references from object files seen after the response file will not be resolved in those libraries.


If you want to add a directory, /libs for example, to the LD_LIBRARY_PATH, you can do either of the following:

To compile file.cpp and link it with the library mylib.a, enter the following command:

prompt>icpc file.cpp mylib.a

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 Intel® Math Library, libimf.a