Microchip Technology XC8 Standard Compiler (Workstation) SW006021-1 SW006021-1 ユーザーズマニュアル

製品コード
SW006021-1
ページ / 518
XC8 Command-line Driver
 2012 Microchip Technology Inc.
DS52053B-page 81
4.4
RUNTIME FILES
In addition to the C and assembly source files specified on the command line, there are 
also compiler-generated source files and pre-compiled library files which might be 
compiled into the project by the driver. These files contain:
• C Standard library routines
• Implicitly called arithmetic routines
• User-defined library routines
• The runtime startup code
• The powerup routine
• The printf routine.
Strictly speaking, the power-up routine is neither a compiler-generated source, nor a 
library routine. It is fully defined by the user, however as it is very closely associated 
with the runtime startup module, it is discussed with the other runtime files in the 
following sections.
4.4.1
Library Files
The names of the C standard library files appropriate for the selected target device, and 
other driver options, are determined by the driver and passed to the code generator and 
linker. You do not need to manually include library files into your project. P-code librar-
ies (.lpp libraries) are used by the code generator, and object code libraries (.lib 
files) are used by the linker. Most library routines are derived from p-code libraries.
By default, xc8 will search the lib directory under the compiler installation directory 
for library files that are required during compilation.
4.4.1.1
STANDARD LIBRARIES
The C standard libraries contain a standardized collection of functions, such as string, 
math and input/output routines. The range of these functions are described in 
Appendix A. “Library Functions”. Although it is considered a library function, the 
printf
 function’s code is not found in these library files. C source code for this func-
tion is generated from a special C template file that is customized after analysis of the 
user’s C code. See Section “PRINTF, VPRINTF” for more information on using the 
printf
 library function and Section 5.11.1 “The printf Routine” for information on 
how the printf function is customized when you build a project.
The libraries also contain C routines that are implicitly called by the output code of the 
code generator. These are routines that perform tasks such as floating-point opera-
tions, integer division and type conversions, and that may not directly correspond to a 
C function call in the source code.
The library name format is family-type-options.lpp, where the following apply.
• family can either be pic18 for PIC18 devices, or pic for all other 8-bit PIC 
devices
• type indicates the sort of library functionality provided and may be stdlib for 
the standard library functions, or trace, etc.
• options indicate hyphen-separated names to indicate variants of the library to 
accommodate different compiler options or modes, e.g., htc for HI-TECH C com-
patibility, d32 for 32-bit doubles, etc.
For example, the standard library for baseline and midrange devices using 24-bit dou-
ble
 types is pic-stdlib-d24.lpp.
All the libraries are present in the lib directory of the compiler installation. Search this 
directory for the full list of all libraries supplied.