Table of Contents Previous Slide Next Slide

Software Development in the UNIX Environment
Compiling Your Program

Include files

System includes /usr/include /usr/include/sys

Use -I path_to_file when include file isn't in the current or system includes directory

Example cc -I /usr/local/lib/pgplot/ file.c

Libraries

System libraries in /usr/lib and /lib

Use -L path_to_file when library isn't in the current or system libraries directories

Example: there are 2 ways to reference the library /usr/local/lib/pgplot/libpgplot.a

f77 -L/usr/local/libpgplot -lpgplot -o myfile myfile.o

f77 -o myfile myfile.o /usr/local/lib/pgplot/libpgplot.a

Some of the Most Often Used Compiling Options