Giter Club home page Giter Club logo

Comments (3)

fabio-d avatar fabio-d commented on July 29, 2024

Hi! Unfortunately the MPLAB X IDE does not work with C++ out of the box, because it assumes that XC16 can only compile C code.

However, you can import XC16++'s example project as a User Makefile Project and workaround the issue. These are the steps that I tested (on MPLAB X v5.30):

  • Open MPLAB X and click on File → New Project, then select User Makefile Project.
    img01

  • In the next screen, select dsPIC33FJ128MC804. Please select this even if you are targeting a different microcontroller, in order to test that at least the example project builds. You will be able to change it later.
    img02

  • In the next screen, select your programmer.
    img03

  • In the next screen, type example-project as the Project Name, browse to the proper Project Location and check the Use project location as the project folder flag.
    img04

  • And now the last wizard screen, which is the most critical one: type . (a single dot) as Working Directory, make all as Build command (and also as Debug build command), make clean as Clean command, result.elf as Image name (and also as Debug image name), then click Finish.
    img05

  • Now navigate to the project folder, delete the Makefile created by MPLAB X and extract XC16++'s example project files (you can find them in the XC16++ ZIP file you already downloaded).
    img06

  • Go back to MPLAB X and build the project (Production → Build Main Project), it will build successfully! Optionally, you can manually add source files to the project so that they show up in the IDE (right-click on a folder in the Project tab, then select Add Existing Item and choose the relevant file/files).
    img07

  • Lastly, edit the first lines in the Makefile to select the microcontroller you are actually targeting. Select the target microcontroller in the File → Project Properties dialog too, and run Production → Clean and Build Main Project.
    img08

You are now ready to customize the example project to you needs! Keep in mind that, if you add or remove source files, you will have to edit the OBJS variable in the Makefile accordingly (it must be a list of all the source files, with .o extension instead of .c/.cpp).

from xc16plusplus.

lexis-megavolt avatar lexis-megavolt commented on July 29, 2024

from xc16plusplus.

lexis-megavolt avatar lexis-megavolt commented on July 29, 2024

from xc16plusplus.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.