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

製品コード
SW006021-1
ページ / 518
MPLAB
®
 XC8 C Compiler User’s Guide
DS52053B-page 44
 2012 Microchip Technology Inc.
3.3.4
How Can I Select Which Compiler I Want to Build With?
The compilation and installation process has been designed to allow you to have more 
than one compiler installed at the same time. You can create a project in MPLAB X IDE 
and then build this project with different compilers by simply changing a setting in the 
project properties.
To select which compiler is actually used when building a project under MPLAB X IDE, 
go to the Project properties dialog. Select the Configuration category in the Project 
Properties dialog (Conf: [default]). A list of XC8 compilers is shown in the Com-
piler Toolchain, on the far right. Select the XC8 compiler you require.
Once selected, the controls for that compiler are then shown by selecting the XC8 
global options, XC8 Compiler and XC8 Linker categories. These reveal a pane of 
options on the right. Note that each category has several panes which can be selected 
from a pull-down menu that is near the top of the pane.
3.3.5
How Can I Change the Compiler's Operating Mode?
The compiler’s operating mode (Free, Standard or PRO, see Section 1.2 “Compiler 
Description and Documentation”
) can be specified as a command line option when 
building on the command line, see Section 4.8.37 “--MODE: Choose Compiler Oper-
ating Mode”
. If you are building under MPLAB X IDE, there is a Project Properties 
selector in the XC8 compiler category, under the Optimizations option selector, see 
Section 4.10.2 “Compiler Category”.
You can only select modes that your license entitles you to use. The Free mode is 
always available; Standard or PRO can be selected if you have purchased a license for 
those modes.
3.3.6
How Do I Build Libraries?
Note that XC8 uses a different code generation framework (OCG) which uses addi-
tional library files to those used by traditional compilers (including XC16 and XC32). 
SeSection 4.3.1 “The Compiler Applications” for general information on the library 
types available and how they fit into the compilation process.
When you have functions and data that are commonly used in applications, you can 
either make all the C source and header files available so other developers can copy 
these into their projects. Alternatively you can bundle these source files up into a library 
which, along with the accompanying header files, can be linked into a project.
Libraries are more convenient because there are fewer files to deal with. Compiling 
code from a library is also be fractionally faster. However, libraries do need to be main-
tained. XC8 must use LPP libraries for library routines written in C; the old-style LIB 
libraries are used for library routines written in assembly source. It is recommended 
that even these libraries be rebuilt if your project is moving to a new compiler version.
Using the compiler driver, libraries can be built by listing all the files that are to be 
included into the library on the command line. None of these files should contain a 
main()
 function, nor settings for configuration bits or any other such data. Use the 
--OUTPUT=lpp
Type” to indicate that a library file is required. For example:
XC8 --chip=16f877a --output=lpp lcd.c utils.c io.c
creates a library file called lcd.lpp. You can specify another name using the -O 
option, see Section 4.8.10 “-O: Specify Output File” or just rename the file.