Microchip Technology SW006023-2 Data Sheet

Page of 238
Compiler Command Line Driver
 2012 Microchip Technology Inc.
DS51686E-page 53
    //sort elements
    sort (coll.begin(), coll.end());
    print_elements(coll, "sorted:  ");
    //sorted reverse
    sort (coll.begin(), coll.end(), greater<int>());
    print_elements(coll, "sorted >: ");
    while(1);
}
The first line of the program includes the header file xc.h, which provides definitions 
for all Special Function Registers (SFRs) on the target device. The second file of the 
program includes the header file plib.h, which provides the necessary prototypes for 
the peripheral library.
Compile the program by typing the following at a command prompt.
xc32-g++ -mprocessor=32MX795F512L -Wl,--defsym=_min_heap_size=0xF000 
-o ex2.elf ex2.cpp
The option -o ex2.elf names the output executable file. This elf file may be loaded 
into MPLAB X IDE.
If a hex file is required, for example, to load into a device programmer, then use the 
following command 
xc32-bin2hex ex2.elf
This creates an Intel hex file named ex2.hex.