Skip to content

Commit 6d8eb49

Browse files
author
Colin Robertson
committed
Acrolinx pass
1 parent fe93e8b commit 6d8eb49

2 files changed

Lines changed: 28 additions & 28 deletions

File tree

docs/build/adding-references-in-visual-cpp-projects.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,56 @@
11
---
22
description: "Learn more about: Consuming libraries and components"
33
title: "Consuming libraries and components in C++ projects"
4-
ms.date: "12/10/2018"
4+
ms.date: 12/18/2020
55
f1_keywords: ["VC.Project.References"]
66
helpviewer_keywords: ["Add References Dialog Box (C++)", ".NET Framework (C++), Add References Dialog Box"]
77
ms.assetid: 12b8f571-0f21-40b3-9404-5318a57e9cb5
88
---
99
# Consuming libraries and components
1010

11-
Often, a C++ project needs to call functions or access data in a binary file such as static library (.lib files), DLL, Windows Runtime component, COM component, or .NET assembly. In these cases, you have to configure the project so that it can find that binary at build time. The specific steps depend on the type of your project, the type of the binary, and whether the binary is being built in the same solution as your project.
11+
C++ projects often need to call functions or access data in a binary file such as static library (LIB files), DLL, Windows Runtime component, COM component, or .NET assembly. In these cases, you have to configure the project so that it can find that binary at build time. The specific steps depend on the type of your project, the type of the binary, and whether the binary gets built in the same solution as your project.
1212

1313
## Consuming libraries downloaded via vcpkg
1414

15-
To consume a library that you have downloaded by using the **vcpkg** package manager, you can ignore the instructions below. See [vcpkg: A C++ package manager for Windows, Linux and MacOS](vcpkg.md) for more information.
15+
To consume a library that you have downloaded by using the **vcpkg** package manager, you can ignore the instructions below. See [vcpkg: A C++ package manager for Windows, Linux, and macOS](vcpkg.md) for more information.
1616

1717
## Consuming static libraries
1818

19-
If your static library project is being built in the same solution:
19+
If your static library project gets built in the same solution:
2020

21-
1. #include the header file(s) for the static library using quotation marks. In a typical solution the path will start with `../<library project name>`. IntelliSense will help you find it.
21+
1. #include the header file(s) for the static library using quotation marks. In a typical solution, the path starts with `../<library project name>`. IntelliSense will help you find it.
2222
2. Add a reference to the static library project. Right-click on **References** under the application project node in **Solution Explorer** and choose **Add Reference**.
2323

24-
If the static library is not part of the solution:
24+
If the static library isn't part of the solution:
2525

2626
1. Right-click on the application project node in **Solution Explorer** and then choose **Properties**.
27-
2. In the **VC++ Directories** property page, add the path to the directory where the .lib file is located in **Library Paths** and add the path to the library header file(s) in **Include Directories**.
28-
3. In the **Linker > Input** property page, add the name of the .lib file to **Additional Dependencies**.
27+
2. In the **VC++ Directories** property page, add the path to the directory that contains the LIB file to **Library Paths**. Then, add the path to the library header file(s) to **Include Directories**.
28+
3. In the **Linker > Input** property page, add the name of the LIB file to **Additional Dependencies**.
2929

3030
## Dynamic link libraries
3131

32-
If the DLL is being built as part of the same solution as the application, follow the same steps as for a static library.
32+
If the DLL gets built as part of the same solution as the application, follow the same steps as for a static library.
3333

34-
If the DLL is not part of the application solution, you need the DLL file, the header(s) with prototypes for the exported functions and classes, and a .lib file that provides the necessary linking information.
34+
If the DLL isn't part of the application solution, you need: the DLL file, the header(s) with prototypes for the exported functions and classes, and a LIB file that provides the necessary linking information.
3535

3636
1. Copy the DLL to the output folder of your project, or to another folder in the standard Windows search path for DLLs. See [Dynamic-Link Library Search Order](/windows/win32/dlls/dynamic-link-library-search-order).
37-
2. Follow steps 1-3 for static libraries to provide the paths to the headers and .lib file.
37+
2. Follow steps 1-3 for static libraries to provide the paths to the headers and LIB file.
3838

3939
## COM objects
4040

41-
If your native C++ application needs to consume a COM object, and that object is *registered*, then all you have to do is call CoCreateInstance and pass in the CLSID of the object. The system will find it in the Windows Registry and load it. A C++/CLI project can consume a COM object in the same way, or by adding a reference to it from the **Add References > COM** list and consuming it through its [Runtime callable wrapper](/dotnet/framework/interop/runtime-callable-wrapper).
41+
If your native C++ application needs to consume a COM object, and that object is *registered*, then all you have to do is call CoCreateInstance and pass in the CLSID of the object. The system will find it in the Windows Registry and load it. A C++/CLI project can consume a COM object in the same way. Or, it can consume it by adding a reference to it from the **Add References > COM** list and consuming it through its [Runtime callable wrapper](/dotnet/framework/interop/runtime-callable-wrapper).
4242

4343
## .NET assemblies and Windows Runtime Components
4444

45-
In UWP or C++/CLI projects, you consume .NET assemblies or Windows Runtime Components by adding a *reference* to the assembly or component. Under the **References** node in a UWP or C++/CLI project, you see references to commonly-used components. Right-click on the **References** node in **Solution Explorer** to bring up the **Reference Manager** and browse through additional components that are known to the system. Click the **Browse** button to navigate to any folder where a custom component is located. Because .NET assemblies and Windows Runtime components contain built-in type information, you can view their methods and classes by right-clicking and choosing **View in Object Browser**.
45+
In UWP or C++/CLI projects, you consume .NET assemblies or Windows Runtime Components by adding a *reference* to the assembly or component. Under the **References** node in a UWP or C++/CLI project, you see references to commonly used components. Right-click on the **References** node in **Solution Explorer** to bring up the **Reference Manager** and browse through the components available on the system. Choose the **Browse** button to navigate to any folder that contains a custom component. Because .NET assemblies and Windows Runtime components contain built-in type information, you can view their methods and classes by right-clicking and choosing **View in Object Browser**.
4646

4747
## Reference properties
4848

49-
Each kind of reference has properties. You can view the properties by selecting the reference in Solution Explorer and pressing **Alt + Enter**, or else right-clicking and choosing **Properties**. Some properties are read-only and some can be modified. However, typically you don't have to manually modify these properties.
49+
Each kind of reference has properties. You can view the properties by selecting the reference in Solution Explorer and pressing **Alt + Enter**, or else right-clicking and choosing **Properties**. Some properties are read-only and some are modifiable. However, typically you don't have to manually modify these properties.
5050

5151
### ActiveX reference properties
5252

53-
ActiveX reference properties are available only for references to COM components. These properties are displayed only when a COM component is selected in the **References** pane. The properties cannot be modified.
53+
ActiveX reference properties are available only for references to COM components. These properties get displayed only when you select a COM component in the **References** pane. The properties aren't modifiable.
5454

5555
- **Control Full Path**
5656

@@ -70,11 +70,11 @@ ActiveX reference properties are available only for references to COM components
7070

7171
- **Wrapper Tool**
7272

73-
Displays the tool that is used to build the interop assembly from the referenced COM library or ActiveX control.
73+
Displays the tool that's used to build the interop assembly from the referenced COM library or ActiveX control.
7474

7575
### Assembly reference properties (C++/CLI)
7676

77-
Assembly reference properties are available only for references to .NET Framework assemblies in C++/CLI projects. These properties are displayed only when a .NET Framework assembly is selected in the **References** pane. The properties cannot be modified.
77+
Assembly reference properties are available only for references to .NET Framework assemblies in C++/CLI projects. These properties get displayed only when you select a .NET Framework assembly in the **References** pane. The properties aren't modifiable.
7878

7979
- **Relative Path**
8080

@@ -94,27 +94,27 @@ The following properties are available on various kinds of references. They enab
9494

9595
- **Reference Assembly Output**
9696

97-
Specifies that this assembly is used in the build process. If **`true`**, the assembly is used on the compiler command line during the build.
97+
Specifies that this assembly gets used in the build process. If **`true`**, the assembly gets used on the compiler command line during the build.
9898

9999
### Project-to-project reference properties
100100

101-
The following properties define a *project-to-project reference* from the project that is selected in the **References** pane to another project in the same solution. For more information, see [Managing references in a project](/visualstudio/ide/managing-references-in-a-project).
101+
The following properties define a *project-to-project reference* from the project that's selected in the **References** pane to another project in the same solution. For more information, see [Managing references in a project](/visualstudio/ide/managing-references-in-a-project).
102102

103103
- **Link Library Dependencies**
104104

105-
When this property is **True**, the project system links into the dependent project the .lib files that are produced by the independent project. Typically, you will specify **True**.
105+
When this property is **True**, the project system links the LIB files that the independent project produces into the dependent project. Typically, you'll specify **True**.
106106

107107
- **Project Identifier**
108108

109-
Uniquely identifies the independent project. The property value is an internal system GUID that cannot be modified.
109+
Uniquely identifies the independent project. The property value is an internal system GUID that isn't modifiable.
110110

111111
- **Use Library Dependency Inputs**
112112

113-
When this property is **False**, the project system will not link into the dependent project the .obj files for the library produced by the independent project. Consequently, this value disables incremental linking. Typically, you will specify **False** because building the application can take a long time if there are many independent projects.
113+
When this property is **False**, the project system won't link the OBJ files for the library that the independent project produces into the dependent project. That's why this value disables incremental linking. Typically, you'll specify **False** because building the application can take a long time if there are many independent projects.
114114

115115
### Read-only reference properties (COM & .NET)
116116

117-
The following properties are found on COM and .NET assembly references, and cannot be modified.
117+
The following properties exist on COM and .NET assembly references, and aren't modifiable.
118118

119119
- **Assembly Name**
120120

@@ -134,7 +134,7 @@ The following properties are found on COM and .NET assembly references, and cann
134134

135135
- **Identity**
136136

137-
For the .NET Frameworkassemblies, displays the full path. For COM components, displays the GUID.
137+
For the .NET Framework assemblies, displays the full path. For COM components, displays the GUID.
138138

139139
- **Label**
140140

@@ -146,11 +146,11 @@ The following properties are found on COM and .NET assembly references, and cann
146146

147147
- **Public Key Token**
148148

149-
Displays the public key token that is used to identify the referenced assembly.
149+
Displays the public key token used to identify the referenced assembly.
150150

151151
- **Strong Name**
152152

153-
**`true`** if the referenced assembly has a strong name. A strong named assembly is uniquely versioned.
153+
**`true`** if the referenced assembly has a strong name. A strong named assembly has a unique version.
154154

155155
- **Version**
156156

docs/build/integrate-vcpkg.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ vcpkg is a cross-platform command-line package manager for C and C++ libraries.
1414

1515
From the vcpkg root directory, run **`vcpkg integrate install`** to configure Visual Studio to locate all vcpkg header files and binaries on a per-user basis. There's no need to edit the VC++ Directories paths in Visual Studio. If you have multiple clones of vcpkg, the clone you run this command from becomes the new default location.
1616

17-
Now you can `#include` headers by typing the folder or header name, and autocomplete assists you. No additional steps are required to link to libraries or to add project references. The following illustration shows how Visual Studio finds the *`azure-storage-cpp`* headers. vcpkg places its headers in the *`/installed`* subfolder, partitioned by target platform. The following diagram shows the list of include files in the *`/was`* subfolder for the library:
17+
Now you can include headers by typing the folder or header name, and autocomplete assists you. You don't need any extra steps to link to libraries or to add project references. The following illustration shows how Visual Studio finds the *`azure-storage-cpp`* headers. vcpkg places its headers in the *`/installed`* subfolder, partitioned by target platform. The following diagram shows the list of include files in the *`/was`* subfolder for the library:
1818

1919
![An IntelliSense autocompletion pop-up window in the Visual Studio editor](media/vcpkg-intellisense.png "vcpkg and IntelliSense")
2020

@@ -38,7 +38,7 @@ In your shell or Terminal window, change directories to the vcpkg root directory
3838

3939
## Remove vcpkg integration
4040

41-
If you've used the **`integrate`** option, you should remove the integration before you remove a vcpkg instance. To remove and clean up your integration, change directories to the vcpkg root directory. On Windows, run **`vcpkg integrate remove`** to ensure the integration is cleaned. On Linux or macOS, run the **`./vcpkg integrate remove`** command.
41+
If you've used the **`integrate`** option, you should remove the integration before you remove a vcpkg instance. To remove and clean up your integration, change directories to the vcpkg root directory. On Windows, run **`vcpkg integrate remove`** to ensure the integration gets cleaned up. On Linux or macOS, run the **`./vcpkg integrate remove`** command.
4242

4343
## See also
4444

0 commit comments

Comments
 (0)