Comments (3)
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.
-
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.
-
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.
-
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.
-
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).
-
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).
-
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.
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.
from xc16plusplus.
from xc16plusplus.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xc16plusplus.