Microchip Technology SW006023-2 Data Sheet
![Microchip Technology](https://files.manualsbrain.com/attachments/cf42c3c895ef469f06d2e47e97fd98d738fcf5cf/common/fit/150/50/7340124dc8aa983aaf764094e2f06faab86f306c03111c5817f7e4e53fb2/brand_logo.gif)
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.
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.
into MPLAB X IDE.
If a hex file is required, for example, to load into a device programmer, then use the
following command
following command
xc32-bin2hex ex2.elf
This creates an Intel hex file named ex2.hex.