Microchip’s new XC++ compiler

Posted on Wednesday, October 31st, 2012 in code, tools by DP

Microchip yesterday announced the XC++ compiler for PIC32 microcontrollers. It’s free to use, but comes with code optimization restrictions in the free version. This compiler adds support for C++ code, and comes with built in Dinkumware template libraries

The MPLAB XC32++ supports all of Microchip’s 32-bit PIC32 microcontrollers (MCUs).  This compiler enables designers to develop and re-use C++ projects by making all of Microchip’s C language extensions available in an environment that is compliant with the majority of C++98 and C++2003 ANSI standards.  Additionally, the Free MPLAB XC32++ Compiler includes Dinkumware® standard C, C++, and template libraries.


This entry was posted on Wednesday, October 31st, 2012 at 11:00 am and is filed under code, tools. You can follow any responses to this entry through the RSS 2.0 feed. You can skip to the end and leave a response. Pinging is currently not allowed.

15 Responses to “Microchip’s new XC++ compiler”

  1. Lloyd Atkinson says:

    I don’t program in C++ (I only know C), so I haven’t actively searched for a C++ compiler for a microcontroller before, but as far as I’m aware this is the ONLY C++ compiler I’ve ever heard of for PIC.

  2. The one I’ve heard before is SourceBoost C++:
    It works for PIC18, PIC16 and some PIC12 (as stated by their description).

  3. Joe Desbonnet says:

    PIC32 is based on MIPS core. I thought there might be a GCC/g++ toolchain, but googling around it seems not (yet anyway).

    • asdf says:

      Since it’s open source, you can always build your own (or use one of the toolsets available for that purpose). If you don’t want to do that, Mentor Graphics/CodeSourcery have a precompiled MIPS toolchain.

    • Peter says:

      As far as I know, Digilent chipkits come with an IDE including a compiler that supports some c++ features. But I did not use or try it.

      • JTR says:

        And full optimizing without time limits. :)

      • Filip says:

        JTR, nope, the free version comes with the classic code optimization restrictions… only pro gets full optimization,

      • asdf says:

        Microchip’s GCC-based compilers only restrict some of the -On optimization switches. However, they are only a shorthand for a whole bunch of individual tuning switches, which are not disabled. You can look up which options are enabled by a specific -On switch in GCC’s documentation and add each one to your compile switches manually. It’s messier and more work, but gives you the same end result.

        There’s also the option of recompiling Microchip’s released GCC sourcecode, with the licensing stuff removed.

  4. jason says:

    I haven’t seen anyone spelling out how to use the GCC compiler as a nice C compiler for PICs (my favorite uC). You guys have some sites?

    • Peter says:

      Microchip’s own PIC32 compiler (C32) *is* GCC, they just don’t want you to know ($$$).
      The other PIC24, PIC16, PIC12, etc. micros are not MIPS-based, so there is no GCC for them.

      • jason says:

        Ah, that makes sense. I always wondered why I had to pay for so-so compilers that I could afford for my PIC16 and PIC18 series. There seemed to be good ones out there that were too rich for my hobby, so was surprised to see this post.

  5. JTR says:

    @Filip. I was clearly replying to the comment about the open source chipkit compiler that is not time restricted… It also now has fully open source libraries too. The C++ support is not “full” C++ but rather a subset that may be improved upon in the future.

  6. Markus Gritsch says:

    The fact that you have to register on the website to get the free license for the XC32 C++ compiler bothers me a bit. Why not just allow using the C++ compiler without the need for a license? Will Microchip at some time end the “Offering” and stop giving out free licenses? Makes me a bit reluctant of using it in a new project.

    • asdf says:

      On Microchip’s forums, someone from their compiler team said that the registration is basically a way for management to gauge interest and decide resource allocation. I have no idea if low interest would mean restricting the C++ compiler to paying customers or discontinuing it altogether.

      • Markus Gritsch says:

        I see. IMO today a C++ compiler is a must-have. It was long overdue for PIC32 MCUs. I was using an STM32 for one project, because C++ compilers are standard for ARM MCUs.

Leave a Reply

Notify me of followup comments via e-mail. You can also subscribe without commenting.

Recent Comments

  • Joe Desbonnet: Ya, I can recommend the low melting point solder. I used brand 'ChipQuik' and it's amazingly easy to use.
  • Jerome: I need a new BusPirate for the Fablab ;) Many thanks!
  • Max: Seems like an unexpectedly violent way to remove the chip indeed. A hot air station should of course do the job just fine, but in...
  • jose: Part removal described here is pure butchery, the cheapest hot air station will do a fast and clean job removing the QFP, heat air to...
  • Cody: Yes please