Skip to content

Commit 2c9307e

Browse files
authored
Merge pull request #441 from MicrosoftDocs/mb-csat
Updates to VC++ Directories per user feedback (CSAT)
2 parents 3298ef8 + ea375ca commit 2c9307e

5 files changed

+56
-31
lines changed

docs/ide/media/vcppdir.png

31.6 KB
Loading

docs/ide/media/vcppdir_libdir.png

11.3 KB
Loading
5.14 KB
Loading
40.2 KB
Loading
Lines changed: 56 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "VC++ Directories Property Page | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "11/21/2017"
4+
ms.date: "11/28/2017"
55
ms.reviewer: ""
66
ms.suite: ""
77
ms.technology: ["cpp-ide"]
@@ -16,52 +16,77 @@ author: "mikeblome"
1616
ms.author: "mblome"
1717
manager: "ghogen"
1818
---
19-
# VC++ Directories property page
19+
# VC++ Directories Property Page
20+
Use this property page to tell Visual Studio which directories to use when building the currently-selected project. To set directories for multiple projects in a solution, use a custom property sheet as described in [Creating reusable property configurations](working-with-project-properties.md#bkmkPropertySheets).
2021

21-
The VC++ Directories property page specifies the directories that Visual Studio uses to build a project.
22+
To access the **VC++ Directories** property page:
23+
1) from the main menu choose **View | Solution Explorer**
24+
2) right-click on the project node (not the top-level solution) and choose **Properties**
25+
3) in the left pane of the **Property Pages** dialog box, expand **Configuration Properties** and select **VC++ Directories**.
2226

23-
To access this property page, in **Solution Explorer**, select the project (not the solution), then on the menu bar, choose **Project > Properties** to open the **Property Pages** dialog box. In the left pane of the **Property Pages** dialog box, select **Configuration Properties > VC++ Directories**.
27+
VC++ Directories properties apply to a project, not the top-level solution node:
2428

25-
When you use Visual Studio to create a project, it inherits certain directories from the default build environment. Many of these directories are given as macros. To examine the current value of a macro, in the right pane of the **VC++ Directories** page, select a property such as **Include Directories** then choose the down-arrow button on the right, and then choose **Edit**. In the dialog box that appears, choose the **Macros>>** button. The dialog expands to show the available macros and their current values. For more information, see [Working with Project Properties](../ide/working-with-project-properties.md).
29+
![Select the project node](media/vcppdir.png "Select the project node to see the VC++ Directories properties")
2630

27-
## Directory property types
31+
If you don't see the property page, make sure you have the project node selected in **Solution Explorer**. Note that a **VC++ Directories** property page for cross-platform projects looks different. For Linux projects, see [VC++ Directories (Linux C++)](../linux/prop-pages/directories-linux.md).
32+
33+
If you are not familiar with *project properties* in Visual Studio, you might find it helpful to first read [Working with project properties](working-with-project-properties.md).
34+
35+
The default settings for VC++ directories depend on project type. For desktop projects they include the VC++ tools locations for a particular Platform Toolset and the Windows SDK location. You can change the **Platform Toolset** and **Windows SDK version** on the **Configuration Properties – General** page. To view the values for any of the directories:
2836

29-
You can specify the directories used by Visual Studio when it searches for specific types of files.
37+
1) in the right pane of the **VC++ Directories** page, select a row. For example, **Library Directories**
38+
2) choose the down-arrow button on the right
39+
3) choose **Edit**.
3040

31-
### Executable Directories
41+
![Edit Library Directories](media/vcppdir_libdir_edit.png "Dialog to edit library paths")
3242

33-
Specifies the directories to search for executable files. Corresponds to the **PATH** environment variable.
43+
You now see a dialog box like this:
3444

35-
### Include Directories
45+
![Show Library Directories](media/vcppdir_libdir.png "Dialog to add or remove library paths")
3646

37-
Specifies the directories to search for include files that are referenced in the source code. Corresponds to the **INCLUDE** environment variable.
47+
Use this dialog to view the current directories. However, if you want to change or add a directory, it is better to use **Property Manager** to create a property sheet or modify the default user property sheet. For more information, see [Creating reusable property configurations](working-with-project-properties.md#bkmkPropertySheets).
3848

39-
### Reference Directories
49+
As shown above, many of the inherited paths are given as macros. To examine the current value of a macro, choose the **Macros** button in the lower right corner of the dialog box. Note that many macros depend on the configuration type. A macro in a debug build might evaluate to a different path than the same macro in a release build.
4050

41-
Specifies the directories to search for assembly and module (metadata) files that are referenced in the source code by the [#using](../preprocessor/hash-using-directive-cpp.md) directive. Corresponds to the **LIBPATH** environment variable.
51+
You can search for partial or complete matches in the edit box. The following illustration shows all the macros that contain the string "WindowsSDK" and it also shows the current path that the macro evaluates to:
4252

43-
### Library Directories
53+
![See macro values](media/vcppdir_libdir_macros.png "Dialog to edit macros")
4454

45-
Specifies the directories to search for libraries (.lib) files; this includes run-time libraries. Corresponds to the **LIB** environment variable. This setting does not apply to .obj files; to link to an .obj file, on the [Linker > General](../ide/linker-property-pages.md) property page, select **Additional Library Dependencies** and then specify the relative path of the file.
55+
Note: The list will populate as you type. Don't press **Enter**.
4656

47-
### Source Directories
57+
For more information about macros and why you should use them instead of hard-coded paths whenever possible, see [Working with Project Properties](../ide/working-with-project-properties.md#bkmkPropertiesVersusMacros).
4858

49-
Specifies the directories to search for source files to use for IntelliSense.
59+
For a list of commonly used macros, see [Common Macros for Build Commands and Properties](https://docs.microsoft.com/en-us/cpp/ide/common-macros-for-build-commands-and-properties).
5060

51-
### Exclude Directories
61+
You can define your own macros in two ways:
62+
- Set environment variables in a developer command prompt. All environment variables are treated as MSBuild properties/macros.
63+
- Define user macros in a .props file. For more information, see [Property page macros](working-with-project-properties.md#bkmkPropertiesVersusMacros).
5264

53-
Specifies the directories not to search when checking for build dependencies.
5465

55-
### To specify or modify directory settings
66+
For more information, see these blog posts: [VC++ Directories](http://blogs.msdn.com/b/vsproject/archive/2009/07/07/vc-directories.aspx), [Inherited Properties and Property Sheets](http://blogs.msdn.com/b/vsproject/archive/2009/06/23/inherited-properties-and-property-sheets.aspx), and [Visual Studio 2010 C++ Project Upgrade Guide](http://blogs.msdn.com/b/vcblog/archive/2010/03/02/visual-studio-2010-c-project-upgrade-guide.aspx).
67+
68+
## Directory Types
69+
You can also specify other directories, as follows.
70+
71+
**Executable Directories**
72+
Directories in which to search for executable files. Corresponds to the **PATH** environment variable.
73+
74+
**Include Directories**
75+
Directories in which to search for include files that are referenced in the source code. Corresponds to the **INCLUDE** environment variable.
76+
77+
**Reference Directories**
78+
Directories in which to search for assembly and module (metadata) files that are referenced in the source code by the [#using](../preprocessor/hash-using-directive-cpp.md) directive. Corresponds to the **LIBPATH** environment variable.
79+
80+
**Library Directories**
81+
Directories in which to search for libraries (.lib) files; this includes run-time libraries. Corresponds to the **LIB** environment variable. This setting does not apply to .obj files; to link to an .obj file, on the [Linker](../ide/linker-property-pages.md)**General** property page, select **Additional Library Dependencies** and then specify the relative path of the file.
82+
83+
**Source Directories**
84+
Directories in which to search for source files to use for IntelliSense.
85+
86+
**Exclude Directories**
87+
Directories not to search when checking for build dependencies.
88+
89+
## Sharing the Settings
90+
You can share project properties with other users or across multiple computers. For more information, see [Working with Project Properties](../ide/working-with-project-properties.md).
5691

57-
1. In **Solution Explorer**, select the project (not the solution) you want to change, and then on the menu bar, choose **Project > Properties** to open the **Property Pages** dialog box.
58-
59-
1. In the left pane of the **Property Pages** dialog box, select **Configuration Properties > VC++ Directories**.
60-
61-
1. To modify one of the directory list properties, select it, choose the down-arrow button on the right, and then choose **Edit**.
62-
63-
In the top edit control in the dialog box that appears, you can add or remove values, and you can rearrange the order in which the values appear. You can also change whether the project inherits any settings by selecting or clearing the **Inherit from parent or project defaults** check box.
64-
65-
## Share the settings
66-
67-
You can share project properties with other users or across multiple computers. For more information, see [Working with Project Properties](../ide/working-with-project-properties.md).
92+

0 commit comments

Comments
 (0)