C/C++ Directories
The
C/C++ Directories node in the
Projects branch of the Visual Assist X
options dialog tells Visual Assist X where to find headers included by your C/C++ code, and which headers it should reparse immediately when modified.
Visual Assist X extracts symbol definitions from headers included by your code. The software does not ship with a pre-built database of symbols. For most users, the default values in the
C/C++ Directories node are correct. The values in the node are taken from IDE and project settings, and are displayed read-only.
Directories from the IDE that apply to all of your projects are considered stable. Changes to your IDE settings and parsing of headers within these directories are done after you install Visual Assist X or when you press
Rebuild on the
Performance node of the options dialog.
Directories from settings associated with individual projects, i.e. project settings, are considered dynamic. Headers within these directories are parsed each time you open a project, and immediately after modification. These directories do not appear in the
C/C++ Directories node since, by default, they change per project.
Locating Headers
Proper setup of the
C/C++ Directories node is essential for proper operation of Visual Assist X. Incorrect setup causes Visual Assist X to find outdated or wrong versions of headers, no headers at all, or not recognize modifications fast enough.
Visual Assist X does not necessarily find headers in the directories searched during a build. The complete path of directories for a build is determined only when a build begins, not during edit when Visual Assist X is active.
You know settings are incorrect if improper paths appear in the
Definition field when your caret is inside an #include statement, if an excessive number of definitions are unknown, or if modifications to headers are not recognized immediately. If any of these problems occur, you must correct settings in your IDE, or switch to custom settings in the
C/C++ Directories node of the Visual Assist X options dialog. You must restart your IDE after a change in either case.
Default Directories
Visual Assist X builds default paths of directories when you start your IDE. Values are extracted from IDE settings, environment variables and project settings. Directories of headers listed in IDE settings common to all projects are considered stable; directories of headers associated with projects are assumed to change more frequently.
Stable include files shown in the
C/C++ Directories node are taken from IDE settings in
Tools|Options|Projects and Solutions|VC++ Directories.
Other include files, i.e. those that change frequently, are those listed in
Project|Properties|Configuration Properties|C/C++|General.
While your IDE is active and a project is open, changes to the IDE settings are detected after you save your project if
Watch for externally modified files is enabled in the Visual Assist X options dialog. If you use property sheets to specify directories in
Visual Studio 2005, you must save the sheets before changes are detected. (Saving the project is insufficient.)
Custom Directories
For some users, default directories are not sufficient. This occurs typically when settings in your IDE are not complete, or when headers associated to one or more projects are listed in project settings. In such cases, you may specify a custom set of directories in which Visual Assist X should search for your headers.
Users who specify custom directories typically:
- Develop software for multiple platforms in which case IDE settings can change often,
- Use a Microsoft IDE for editing non-Microsoft projects so IDE settings are not set at all,
- Have stable directories, e.g. BOOST, listed in Project|Settings, (Headers located using stable directories are parsed less often and yield better performance.)
- Configure IDE settings improperly.
Create custom directories by changing platform to
Custom. The directory list is no longer read-only. The initial values for Custom are the directories in use currently. If a project is open, the initial values include the directories in the project settings.
Modify the list using the toolbar in the dialog. The icons to copy and paste are useful if you must list numerous directories.
List only the directories a compiler would need to locate headers, e.g. C:\BOOST. Do not list subdirectories.
You can create only one set of custom directories. You can switch between custom and non-custom directories without losing your settings.
Headers are found by searching directories in the order you specify.
Stable versus Other Directories
When creating custom lists, place directories of headers in either the
Stable or
Other list.
Stable include files rarely change. They are parsed infrequenly and definitions are stored in a read-only, static database for fast lookup and global access. Use the
Rebuild button on the
Performance node of the Visual Assist X
options dialog to make Visual Assist X recognize modifications to these headers.
Directories specified in IDE settings associated with your projects are always used and should not be added to any of the lists in the
C/C++ Directories node.
Support for Multiple Platforms
Developers creating software for multiple platforms typically have headers for each platform supported. You must tell Visual Assist X the platform whose code you are editing at any one time. Visual Assist X searches the directories appropriate for the platform and displays definitions you expect.
Visual Assist X stores a default set of directories for each platform. The values are extracted from IDE settings and from your environment.
Building for a specific platform does not change the platform for which Visual Assist X assumes you are editing. If you need definitions for a different platform, you must change the platform setting
C/C++ Directories node and restart your IDE.
Locating Implementations
Visual Assist X searches for implementations when you press the
Goto button. By default, Visual Assist X searches for implementations in all source files in your projects, and in source files found using IDE settings.
When Platform is Custom, specify additional sources in which Visual Assist X should search.
You must restart your IDE if you modify any of the values in the
C/C++ Directories node.