- Introduction to GNU C and C++ Compilers
- Installing GNU Compiler
- Compiling a Program
- Linking a program
- Assembling a Program
- Handling Warning and Error messages
- Include files
- Creating Libraries
- Standard Libraries
- Compiling Pascal Programs
- Compiling Fortran Programs
- Other Compilers
- References and Resources
3.8 Creating Libraries
Libraries are files containing commonly used functions needed for all programs. For example, printf() is a function used in most of the C programs. When the program is linked, the linker must know where the code for the printf() function is located. Knowledge of location of library files is a must at this stage. The location can be passed to the linker using command line options or environment variables. In large software projects, this is done inside Makefiles. The environment variable that shows the location of library files is LD_LIBRARY_PATH. Please see the list of command line options in this chapter or use manual pages to find out which options are appropriate.