When adding files to a project, you will be presented with a choice regarding how to store the paths that the project uses to reference the files. At the bottom right of the Add Existing Item dialog box, you will see three radio buttons labeled Auto, Relative and Absolute.
Auto: Store path as relative to project root if inside project, otherwise store as absolute path
Relative: Store path as relative to project root
Absolute: Store path as absolute path
In general, if a file is inside your project folder, you should choose Relative. This gives you the flexibility to move or rename the project without breaking the links to that file. Absolute is useful for files that are outside your project directory but will not be moved. Then, no matter where you move your project, you will always be pointing correctly to those files. The Auto option will make this choice for you automatically. However, Relative may be desirable files outside of the project directory if the project is created within a larger framework or library, where everything may be moved together to a new location. As long as all files maintain their relative positions to the project root, all file links should still work properly.
With MPLAB X's default settings, Relative will always be the default selection. If you would prefer that Auto or Absolute were selected by default, you may change this option:
From the main menu, select Tools > Options
Select the Embedded icon along the top of the window.
Select the Project Options tab.
Information contained in this publication regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.