When creating projects with linked folders (whether manually or using one of C/C++test available project importers for supported IDEs), the default settings have linked folders specified by absolute path. This may be fine a single desktop user, but it could present a problem if the project is shared by multiple developers who have source code checked out in different root locations. In this case, it is safer to create linked folders using a variable, which you then set to your preference.
To add a linked folder to an existing project:
If you wanted to add a folder with a variable for the root location:
When you check the Properties> Resource on the new folder, the folder location is defined in terms of the root variable (DEMO_DIR in this case), and the resolved path is provided as well:
The directory variables that are specified in the linked folder dialog can be accessed via Window> Preferences> General> Workspace> Linked Resources. They should be set up for each user, and their values are stored in the user’s Eclipse workspace. These variables do not appear in the user’s shell environment on the workstation—and they should not be set there. If you ever need to recreate the workspace, it is easy to re-define these variables when the projects using them are imported into the new workspace.
Note that multiple variables can be used when setting up linked folders to bundle together directories that are in multiple relative locations. Remember to update your preferences with the variable values matching your directory setup.