Basically, if the library and the headers are installed in standard directories, you only have to link against the library. If you are using GCC, you probably want:
If you have not installed the library in a standard directory, you have to indicate the header directory when compiling and the library directory when linking. With GCC:
The -Wl,-R/my/library/path flag adds the library directory to the list used to search dynamic libraries at run-time (-L is only used at compile-time).
If you are using the Autotools, see the next section.