# Specifying the location of source files

You can specify the location of source files used when debugging a C or C++ application. By default, this information is taken from the build path of your project.

To specify the location of source files:

1. In the C/C++ Projects view, select a project.
2. Click Run > Run or Run > Debug.
3. In the Configurations box, expand C/C++ Local.
4. Select a run or debug configuration.
5. Click the Source tab.

   The Generic Source Locations list shows the location of the project selected in the C/C++ Projects view and any referenced projects.

6. To add an existing source locations:
   - Click Add to be prompted to select a process from a list at run-time.
   - In the Add Source Location dialog box, select a location type.
   - Click Next.
   - Do one of the following:
   - Select an existing project in your workspace. Click Finish.
   - Specify a location in your file system. Click Finish.
7. You can change the order of source locations are used by selecting a location and clicking the Up or Down buttons.
8. You can remove a source location by selecting the location and clicking the Remove button.
9. To search for duplications in your source locations select the Search for duplicate source files checkbox.
10. Click Run or do the following, as required:
    - To specify the execution arguments that an application uses and the working directory for a run configuration, see Specifying execution arguments.
    - To set the environment variables and values to use when an application runs, see Setting environment variables.
    - To select a debugger to use when debugging an application, see Selecting a debugger.
    - To specify where the run configuration is stored, how you access it, and the perspective to open when running an application, see Specifying the location of the run configuration.

CDT Projects
Project file views

Creating or editing a run configuration

Run and Debug dialog box