Jump to content

Using common files with differnt projects

Recommended Posts

This subject as discussed many years ago before the times of MPLAB X, and as far as I understand did not work properly.

But now sourceboost compiler is an "approved" MPLAB x compiler, so before I try experimenting maybe someone already did this and can comment:

If I have several projects  -each in its own directory

I have several c and h files which are common to al projects and I want them to be located in their own directory (and maintain only one copy of them, as opposed to have them in each of the projects directory and copy-paste files each time I make a change in them).

Is it possible by simply adding this common directory to the search path of each project in MPLAB X(File->project properties->general->source folders)

Link to comment
Share on other sites

  • 3 weeks later...



It shouldn't be a problem, AFAIK it can be done with any toolchain and/or IDE out there.

For header (.h) files you just need to put the path in the #include statement.

For source files (.c) you have to provide those extra paths to the makefile.

Besides this universal steps, In MPLABX, specifically, you can include extra folders in your project tree.


Best regards



Link to comment
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...