# Vault 7: Projects

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

### Protego

# MPLAB XC16 C-Compiler

- 1
- 2
…
- 58
- 59
- 60
- 61
- 62
…
- 365
- 366

MPLAB
®
XC16 C Compiler Users Guide
DS50002071C-page 60  2012-2013 Microchip Technology Inc.
3.6.3 Set Build Options
Select File>Project Properties or right click on the project name and select Properties
to open the Project Properties dialog.
1. Under Conf:[default]>XC16 (Global Options), select xc16-gcc.
2. Select Preprocessing and messages from the Option Categories. Enter the
following path for C Include Dirs:
C:\Program Files\Microchip\xc16\vx.xx\support\dsPIC30F\h
where vx.xx is the version number.
3. Under Conf:[default]>XC16 (Global Options), select xc16-ld.
4. Select Diagnostics from the Option Categories. Then enter a file name to
Generate map file, i.e., example.map.
5. Click OK on the bottom of the dialog to accept the build options and close the
dialog.
3.6.4 Build the Project
Right click on the project name, MyXC16Project, in the project tree and select Build
from the pop-up menu. The Output window displays the build results.
If the build did not complete successfully, check these items:
1. Review the previous steps in this example. Make sure you have set up the lan-
guage tools correctly and have all the correct project files and build options.
2. If you modified the sample source code, examine the Build tab of the Output win-
dow for syntax errors in the source code. If you find any, click on the error to go
to the source code line that contains that error. Correct the error, and then try to
build again.
3.6.5 Output Files
View the project output files by opening the files in MPLAB X IDE.
1. Select File>Open
File. In the Open dialog, find the project directory.
2. Under Files of type select All Files to see all project files.
3. Select File>Open File
. In the Open dialog, select example.map. Click Open to
view the linker map file in an MPLAB X IDE editor window. For more on this file,
see the linker documentation.
4. Select File>Open File
. In the Open dialog, return to the project directory and then
go to the dist>default>production
directory. Notice that there is only one hex file,
MyXC16Project.X.production.hex. This is the primary output file. Click Open to
view the hex file in an MPLAB X IDE editor window. For more on this file, see the
Utilities documentation.
There is also another file, MyXC16Project.X.production.cof or MyXC16Proj-
ect.X.production.elf. This file contains debug information and is used by debug
tools to debug your code. For information on selecting the type of debug file, see
Section 3.5.1 XC16 (Global Options).

- 1
- 2
…
- 58
- 59
- 60
- 61
- 62
…
- 365
- 366