# Vault 7: Projects

This publication series is about specific projects related to the Vault 7 main publication.

### Protego

# MPLAB XC16 C-Compiler

- 1
- 2
…
- 211
- 212
- 213
- 214
- 215
…
- 365
- 366

MPLAB
®
XC16 C COMPILER
USERS GUIDE
 2012-2013 Microchip Technology Inc. DS50002071C-page 213
Chapter 17. Library Routines
Many library functions or routines (and any associated variables) will be automatically
linked into a program once they have been referenced in your source code. The use of
a function from one library file will not include any other functions from that library. Only
used library functions will be linked into the program output and consume memory.
Library and precompiled object files are stored in the compilers installation directory
structure.
Your program will require declarations for any functions or symbols used from libraries.
These are contained in the standard C header (.h) files. Header files are not library
files and the two files types should not be confused. Library files contain precompiled
code, typically functions and variable definitions; the header files provide declarations
(as opposed to definitions) for functions, variables and types in the library files, as well
as other preprocessor macros.
The include directories, under the compilers installation directory, are where the
compiler stores the standard C library system header files. The installation will
automatically locate its bundled include files.
Some libraries require manual inclusion in your project, or require special options to
use. See the 16-Bit Language Tools Libraries (DS51456) for questions about particular
libraries.
Libraries which are found automatically include:
 Standard C library
 dsPIC30 support libraries
 Standard IEEE floating point library
 Fixed point library
 Device peripheral library
EXAMPLE 17-1: USING THE MATH LIBRARY
#include <math.h> // declare function prototype for sqrt
void main(void)
{
double i;
// sqrt referenced; sqrt will be linked in from library file
i = sqrt(23.5);
}

- 1
- 2
…
- 211
- 212
- 213
- 214
- 215
…
- 365
- 366