Linkage:
When you need to use a dynamic library in your product, you have to install the library in your computer. You may use dynamic libraries as dependent libraries (by specifying them in your product’s link line) or as runtime loaded libraries (by loading them when they are needed, using dlopen(3) OS X Developer Tools Manual Page
).
Installing Dependent Libraries
Before you can use a dynamic library as a dependent library, the library and its header files must be installed on your computer. The standard locations for header files are ~/include
,/usr/local/include
and /usr/include
. The standard locations for dynamic libraries are ~/lib
,/usr/local/lib
, and /usr/lib
.
You may also place the .dylib
file at a nonstandard location in your file system, but you must add that location to one of these environment variables:
-
LD_LIBRARY_PATH
-
DYLD_LIBRARY_PATH
-
DYLD_FALLBACK_LIBRARY_PATH
For Example: We require that the Averages 1.1 and Ratings 1.1 dynamic libraries be installed on your computer. To install these libraries:
-
Open this document’s companion-file package.
-
In Terminal, execute these commands:
[Averages/1.1]% make install
[Ratings/1.1]% make install