Microchip Technology XC8 Standard Compiler (Workstation) SW006021-1 SW006021-1 Benutzerhandbuch

Produktcode
SW006021-1
Seite von 518
XC8 Command-line Driver
 2012 Microchip Technology Inc.
DS52053B-page 95
4.8.4
-G: Generate Source-Level Symbol File
The -G option allows specification of the filename used for the source-level symbol file 
(.sym extension) for use with supported debuggers and simulators such as MPLAB 
IDE. See also Section 4.5 “Compiler Output”.
If no filename is given, the symbol file will have the project name (see 
Section 4.2 “Invoking the Compiler”), and an extension of .sym. For example, the 
option -Gtest.sym generates a symbol file called test.sym. Symbol files generated 
using the -G option include source-level information for use with source-level debug-
gers.
4.8.5
-I: Include Search Path
Use -I to specify an additional directory to search for header files which have been 
included using the #include directive. The directory can either be an absolute or rel-
ative path. The -I option can be used more than once if multiple directories are to be 
searched.
The compiler’s include directory containing all standard header files is always 
searched, even if no -I option is present. If header filenames are specified using quote 
characters rather than angle brackets, as in #include "lcd.h", then the current 
working directory is searched in addition to the compiler’s include directory. Note that 
if compiling within MPLAB IDE, the search path is relative to the output directory, not 
the project directory.
These default search paths are searched after any user-specified directories have 
been searched. For example:
xc8
 --CHIP=16F877AA -C -Ic:\include -Id:\myapp\include test.c
will search the directories c:\include and d:\myapp\include for any header files 
included into the source code, then search the default include directory.
This option has no effect for files that are included into assembly source using the 
assembly INCLUDE directive. See Section 6.4.10.4 “INCLUDE”.
4.8.6
-L: Scan Library
The -L option is used to specify additional libraries which are to be scanned by the 
linker. Libraries specified using the -L option are scanned before the standard C library, 
allowing additional versions of standard library functions to be accessed.
The argument to -L is a library keyword to which the prefix pic; numbers representing 
the device range, number of ROM pages and the number of RAM banks; and the suffix 
.lib
 are added.
Thus the option -Ll when compiling for a 16F877A will, for example, scan the library 
pic42c-l.lib
 and the option -Lxx will scan a library called pic42c-xx.lib.
All libraries must be located in the lib directory of the compiler installation directory.
As indicated, the argument to the -L option is not a complete library filename. If you 
wish the linker to scan libraries whose names do not follow the above naming conven-
tion or whose locations are not in the lib subdirectory, simply include the libraries’ 
names on the command line along with your source files, or add these to your project.