You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
12
12
13
13
## Consuming libraries downloaded via vcpkg
14
14
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.
16
16
17
17
## Consuming static libraries
18
18
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:
20
20
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.
22
22
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**.
23
23
24
-
If the static library is not part of the solution:
24
+
If the static library isn't part of the solution:
25
25
26
26
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**.
29
29
30
30
## Dynamic link libraries
31
31
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.
33
33
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.
35
35
36
36
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.
38
38
39
39
## COM objects
40
40
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).
42
42
43
43
## .NET assemblies and Windows Runtime Components
44
44
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 commonlyused 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**.
46
46
47
47
## Reference properties
48
48
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.
50
50
51
51
### ActiveX reference properties
52
52
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.
54
54
55
55
-**Control Full Path**
56
56
@@ -70,11 +70,11 @@ ActiveX reference properties are available only for references to COM components
70
70
71
71
-**Wrapper Tool**
72
72
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.
74
74
75
75
### Assembly reference properties (C++/CLI)
76
76
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.
78
78
79
79
-**Relative Path**
80
80
@@ -94,27 +94,27 @@ The following properties are available on various kinds of references. They enab
94
94
95
95
-**Reference Assembly Output**
96
96
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.
98
98
99
99
### Project-to-project reference properties
100
100
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).
102
102
103
103
-**Link Library Dependencies**
104
104
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**.
106
106
107
107
-**Project Identifier**
108
108
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.
110
110
111
111
-**Use Library Dependency Inputs**
112
112
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.
114
114
115
115
### Read-only reference properties (COM & .NET)
116
116
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.
118
118
119
119
-**Assembly Name**
120
120
@@ -134,7 +134,7 @@ The following properties are found on COM and .NET assembly references, and cann
134
134
135
135
-**Identity**
136
136
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.
138
138
139
139
-**Label**
140
140
@@ -146,11 +146,11 @@ The following properties are found on COM and .NET assembly references, and cann
146
146
147
147
-**Public Key Token**
148
148
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.
150
150
151
151
-**Strong Name**
152
152
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.
Copy file name to clipboardExpand all lines: docs/build/integrate-vcpkg.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ vcpkg is a cross-platform command-line package manager for C and C++ libraries.
14
14
15
15
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.
16
16
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:
18
18
19
19

20
20
@@ -38,7 +38,7 @@ In your shell or Terminal window, change directories to the vcpkg root directory
38
38
39
39
## Remove vcpkg integration
40
40
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.
0 commit comments