SW006015 Microchip Technology, SW006015 Datasheet - Page 45

C COMPILER MPLAB C32

SW006015

Manufacturer Part Number
SW006015
Description
C COMPILER MPLAB C32
Manufacturer
Microchip Technology
Type
Compilerr
Series
PIC32r
Datasheets

Specifications of SW006015

Supported Families
PIC32MX5, MX6, And MX7
Core Architecture
PIC
Kit Contents
Software And Docs
Mcu Supported Families
PIC32 MCUs
Tool Function
Compiler
Supported Devices
PIC32 MCUs
Tool Type
Compiler
Processor Series
PIC32
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
PIC32
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
1.10
© 2007 Microchip Technology Inc.
COMPILING MULTIPLE FILES ON THE COMMAND LINE
Move the Add() function into a file called add.c to demonstrate the use of multiple
files in an application. That is:
File 1
/* ex1.c */
#include <p32xxxx.h>
int main(void);
unsigned int add(unsigned int a, unsigned int b);
unsigned int x, y, z;
int main(void)
{
}
File 2
/* add.c */
#include <p32xxxx.h>
unsigned int
add(unsigned int a, unsigned int b)
{
}
Compile both files by typing the following at a DOS prompt:
C:\> pic32-gcc -o ex1.out ex1.c add.c
This command compiles the modules ex1.c and add.c. The compiled modules are
linked with the compiler libraries and the executable file ex1.out is created.
x = 2;
y = 5;
z = Add(x,y);
return 0;
return(a+b);
DS51686A-page 41

Related parts for SW006015