How to copy a project in MPLAB IDE

I want to copy an existing project / workspace that has our working code to a new project so I can write some test code but still be able to keep the working code intact. I tried just copying the folder the workspace was in and renaming the folder, but it still thought the source files were in the original folder.

If I use the new project wizard, it doesn’t come with the proper options as a default and I seem to have missed something because now the code doesn’t compile.


Just save the workspace to a different folder and then open that workspace save file for testing and use the original workspace save file as a copy of your working code.

Sorry if that’s hard to understand. I’ve never been good at explaining details without a visual. :stuck_out_tongue:

I have always been able to just copy every file in the folder, and then paste them into another empty folder that is already named. Never had any problems with that, but MPLAB does have its ways.

After you use the Project Wizard to create a new project the main setting that’s missing is the Include Path.
Project -> Build Options… -> Project
click on Browse by the “Include Path” field and it will usually have the “h” directory already highlighted and you can just click “OK.” If it isn’t then navigate to C:\mcc18\h\ and use that.

Under the MPLAB C18 tab click “Use alternate Settings” and add
at the end of the string that’s already there.

Any files that were open in the original workspace will be reopened when you open the new copy of the project. Just close them all. When you open a file from the list in the new project, it should open the correct one.

You’ll also have to do a “clean build” of the project the first time so it doesn’t remember the object files from the previous folder. If you don’t do that, you’re likely to get an error about some symbol being non-overlay and defined multiple times.