In the most general case, however, you may have to use libraries that are not known to the compiler. In such cases, in order to use the library routines you will also typically need some header files that define information about the data structures and/or functions provided by the library. In this case, there are three things that you need to specify when invoking the C compiler: (i) the library name(s); (ii) the list of directories to search for include files; and (iii) the list of directories to search for the libraries themselves:
Library name: -llibname (-l: lower case letter L) include file directories: -I directory-name (-I: upper case letter i) library code directories: -L directory-name
You do this by invoking the C compiler as follows. Suppose we have a library with the following characteristics:
Name: myIO Include file directory: /home/cs352/FALL02/hw4_stuff Library directory: /home/cs352/FALL02/hw4_stuff/lib
Then you invoke the C compiler as:
gcc ... -I /home/cs352/FALL02/hw4_stuff -L /home/cs352/FALL02/hw4_stuff/lib -lmyIO