Skip to content

Commit cc41959

Browse files
committed
Add minor changes
1 parent 5a1fc82 commit cc41959

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

docs/build/walkthrough-compile-a-c-program-on-the-command-line.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ Certain library functions and POSIX function names are deprecated by MSVC. The f
179179
180180
## Related content
181181
182-
- [Walkthrough: Create a Standard C++ Program](../windows/walkthrough-creating-a-standard-cpp-program-cpp.md)\
183-
- [C Language Reference](../c-language/c-language-reference.md)\
184-
- [C/C++ projects and build systems](projects-and-build-systems-cpp.md)\
182+
- [Walkthrough: Create a Standard C++ Program](../windows/walkthrough-creating-a-standard-cpp-program-cpp.md)
183+
- [C Language Reference](../c-language/c-language-reference.md)
184+
- [C/C++ projects and build systems](projects-and-build-systems-cpp.md)
185185
- [Compatibility](../c-runtime-library/compatibility.md)

docs/build/walkthrough-creating-and-using-a-dynamic-link-library-cpp.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ Right now, this DLL doesn't do very much. Next, you'll create a header file to d
134134

135135
1. To create a header file for your functions, on the menu bar, choose **Project** > **Add New Item**.
136136

137-
1. In the **Add New Item** dialog box, in the left pane, select **Visual C++**. In the center pane, select **Header File (.h)**. Specify *MathLibrary.h* as the name for the header file.
137+
1. In the **Add New Item** dialog box, in the left pane, select **Visual C++**. In the center pane, select **Header File (.h)**. Specify *`MathLibrary.h`* as the name for the header file.
138138

139139
:::image type="content" source="media/mathlibrary-add-new-item-header-file.png" alt-text="Screenshot of the Add New Item dialog with the C plus plus Header File template selected, and MathLibrary.h entered in the Name textbox.":::
140140

@@ -191,11 +191,11 @@ When the `MATHLIBRARY_EXPORTS` macro is defined, the `MATHLIBRARY_API` macro set
191191
192192
::: moniker range=">=msvc-160"
193193
194-
1. In **Solution Explorer**, right-click on the **Source Files** node and choose **Add** > **New Item**. Create a new .cpp file called *MathLibrary.cpp*, in the same way that you added a new header file in the previous step.
194+
1. In **Solution Explorer**, right-click on the **Source Files** node and choose **Add** > **New Item**. Create a new *`.cpp`* file called *`MathLibrary.cpp`*, in the same way that you added a new header file in the previous step.
195195
196196
1. In the editor window, select the **MathLibrary.cpp** tab if it's already open. If not, in **Solution Explorer**, double-click **MathLibrary.cpp** in the **Source Files** folder of the **MathLibrary** project to open it.
197197
198-
1. In the editor, replace the contents of the *MathLibrary.cpp* file with the following code:
198+
1. In the editor, replace the contents of the *`MathLibrary.cpp`* file with the following code:
199199
200200
```cpp
201201
// MathLibrary.cpp : Defines the exported functions for the DLL.
@@ -262,7 +262,7 @@ When the `MATHLIBRARY_EXPORTS` macro is defined, the `MATHLIBRARY_API` macro set
262262

263263
1. In the editor window, select the tab for **MathLibrary.cpp** if it's already open. If not, in **Solution Explorer**, double-click **MathLibrary.cpp** in the **Source Files** folder of the **MathLibrary** project to open it.
264264
265-
1. In the editor, replace the contents of the *MathLibrary.cpp* file with the following code:
265+
1. In the editor, replace the contents of the *`MathLibrary.cpp`* file with the following code:
266266
267267
```cpp
268268
// MathLibrary.cpp : Defines the exported functions for the DLL.
@@ -398,7 +398,7 @@ To avoid out-of-sync code, we recommend you set the include path in your client
398398

399399
1. Choose the **Create** button to create the client project.
400400

401-
A minimal console application project is created for you. The name for the main source file is the same as the project name that you entered earlier. In this example, it's named *MathClient.cpp*. You can build it, but it doesn't use your DLL yet.
401+
A minimal console application project is created for you. The name for the main source file is the same as the project name that you entered earlier. In this example, it's named *`MathClient.cpp`*. You can build it, but it doesn't use your DLL yet.
402402

403403
::: moniker-end
404404

@@ -414,7 +414,7 @@ A minimal console application project is created for you. The name for the main
414414

415415
1. Choose **OK** to create the client app project.
416416

417-
A minimal console application project is created for you. The name for the main source file is the same as the project name that you entered earlier. In this example, it's named *MathClient.cpp*. You can build it, but it doesn't use your DLL yet.
417+
A minimal console application project is created for you. The name for the main source file is the same as the project name that you entered earlier. In this example, it's named *`MathClient.cpp`*. You can build it, but it doesn't use your DLL yet.
418418

419419
::: moniker-end
420420

@@ -434,11 +434,11 @@ A minimal console application project is created for you. The name for the main
434434

435435
1. Choose the **Finish** button to create the project.
436436

437-
When the wizard finishes, a minimal console application project is created for you. The name for the main source file is the same as the project name that you entered earlier. In this example, it's named *MathClient.cpp*. You can build it, but it doesn't use your DLL yet.
437+
When the wizard finishes, a minimal console application project is created for you. The name for the main source file is the same as the project name that you entered earlier. In this example, it's named *`MathClient.cpp`*. You can build it, but it doesn't use your DLL yet.
438438

439439
::: moniker-end
440440

441-
Next, to call the MathLibrary functions in your source code, your project must include the *MathLibrary.h* file. You could copy this header file into your client app project, then add it to the project as an existing item. This method can be a good choice for third-party libraries. However, if you're working on the code for your DLL and your client at the same time, the header files could get out of sync. To avoid this issue, set the **Additional Include Directories** path in your project to include the path to the original header.
441+
Next, to call the MathLibrary functions in your source code, your project must include the *`MathLibrary.h`* file. You could copy this header file into your client app project, then add it to the project as an existing item. This method can be a good choice for third-party libraries. However, if you're working on the code for your DLL and your client at the same time, the header files could get out of sync. To avoid this issue, set the **Additional Include Directories** path in your project to include the path to the original header.
442442

443443
### To add the DLL header to your include path
444444

@@ -454,7 +454,7 @@ Next, to call the MathLibrary functions in your source code, your project must i
454454

455455
1. Double-click in the top pane of the **Additional Include Directories** dialog box to enable an edit control. Or, choose the folder icon to create a new entry.
456456

457-
1. In the edit control, specify the path to the location of the *MathLibrary.h* header file. You can choose the ellipsis (**...**) control to browse to the correct folder.
457+
1. In the edit control, specify the path to the location of the *`MathLibrary.h`* header file. You can choose the ellipsis (**...**) control to browse to the correct folder.
458458

459459
You can also enter a relative path from your client source files to the folder that contains the DLL header files. If you followed the directions to put your client project in a separate solution from the DLL, the relative path should look like this:
460460

@@ -470,7 +470,7 @@ Next, to call the MathLibrary functions in your source code, your project must i
470470

471471
1. After you've entered the path to the header file in the **Additional Include Directories** dialog box, choose the **OK** button. In the **Property Pages** dialog box, choose the **OK** button to save your changes.
472472

473-
You can now include the *MathLibrary.h* file and use the functions it declares in your client application. Replace the contents of *MathClient.cpp* by using this code:
473+
You can now include the *`MathLibrary.h`* file and use the functions it declares in your client application. Replace the contents of *`MathClient.cpp`* by using this code:
474474

475475
```cpp
476476
// MathClient.cpp : Client app for MathLibrary DLL.
@@ -494,9 +494,9 @@ int main()
494494
}
495495
```
496496

497-
This code can be compiled, but not linked. If you build the client app now, the error list shows several LNK2019 errors. That's because your project is missing some information: You haven't specified that your project has a dependency on the *MathLibrary.lib* library yet. And, you haven't told the linker how to find the *MathLibrary.lib* file.
497+
This code can be compiled, but not linked. If you build the client app now, the error list shows several LNK2019 errors. That's because your project is missing some information: You haven't specified that your project has a dependency on the *`MathLibrary.lib`* library yet. And, you haven't told the linker how to find the *`MathLibrary.lib`* file.
498498

499-
To fix this issue, you could copy the library file directly into your client app project. The linker would find and use it automatically. However, if both the library and the client app are under development, that might lead to changes in one copy that aren't shown in the other. To avoid this issue, you can set the **Additional Dependencies** property to tell the build system that your project depends on *MathLibrary.lib*. And, you can set an **Additional Library Directories** path in your project to include the path to the original library when you link.
499+
To fix this issue, you could copy the library file directly into your client app project. The linker would find and use it automatically. However, if both the library and the client app are under development, that might lead to changes in one copy that aren't shown in the other. To avoid this issue, you can set the **Additional Dependencies** property to tell the build system that your project depends on *`MathLibrary.lib`*. And, you can set an **Additional Library Directories** path in your project to include the path to the original library when you link.
500500

501501
### To add the DLL import library to your project
502502

@@ -508,7 +508,7 @@ To fix this issue, you could copy the library file directly into your client app
508508

509509
:::image type="content" source="media/mathclient-additional-dependencies-property.png" alt-text="Screenshot of the Property Pages dialog box under Input that shows the Edit command in the Additional Dependencies property dropdown.":::
510510

511-
1. In the **Additional Dependencies** dialog, add *MathLibrary.lib* to the list in the top edit control.
511+
1. In the **Additional Dependencies** dialog, add *`MathLibrary.lib`* to the list in the top edit control.
512512

513513
:::image type="content" source="media/mathclient-additional-dependencies.png" alt-text="Screenshot of the Additional Dependencies dialog box showing the MathLibrary.lib file.":::
514514

@@ -518,7 +518,7 @@ To fix this issue, you could copy the library file directly into your client app
518518

519519
:::image type="content" source="media/mathclient-additional-library-directories-property.png" alt-text="Screenshot of the Property Pages dialog box under General that shows the Edit command in the Additional Library Directories property dropdown.":::
520520

521-
1. Double-click in the top pane of the **Additional Library Directories** dialog box to enable an edit control. In the edit control, specify the path to the location of the *MathLibrary.lib* file. By default, it's in a folder called *Debug* directly under the DLL solution folder. If you create a release build, the file is placed in a folder called *Release*. You can use the `$(IntDir)` macro so that the linker can find your DLL, no matter which kind of build you create. If you followed the directions to put your client project in a separate solution from the DLL project, the relative path should look like this:
521+
1. Double-click in the top pane of the **Additional Library Directories** dialog box to enable an edit control. In the edit control, specify the path to the location of the *`MathLibrary.lib`* file. By default, it's in a folder called *Debug* directly under the DLL solution folder. If you create a release build, the file is placed in a folder called *Release*. You can use the `$(IntDir)` macro so that the linker can find your DLL, no matter which kind of build you create. If you followed the directions to put your client project in a separate solution from the DLL project, the relative path should look like this:
522522

523523
`..\..\MathLibrary\$(IntDir)`
524524

docs/windows/walkthrough-creating-windows-desktop-applications-cpp.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ To see the steps for your preferred version of Visual Studio, use the **Version*
5353
The animation shows right-clicking on the project name in Solution Explorer, choosing Add in the menu that appears, and then choosing New Item.
5454
:::image-end:::
5555

56-
1. In the **Add New Item** dialog box, select **C++ File (.cpp)**. In the **Name** box, type a name for the file, for example, *HelloWindowsDesktop.cpp*. Choose **Add**.
56+
1. In the **Add New Item** dialog box, select **C++ File (.cpp)**. In the **Name** box, type a name for the file, for example, *`HelloWindowsDesktop.cpp`*. Choose **Add**.
5757

5858
:::image type="content" source="../build/media/desktop-app-add-cpp-file-153.png" alt-text="Screenshot of the Add New Item dialog box in Visual Studio 2019. The C plus plus File (.cpp) option is selected. The name field is set to Hello Windows Desktop.cpp.":::
5959

@@ -81,7 +81,7 @@ Your project is now created and your source file is opened in the editor.
8181
The animation shows right-clicking on the project name in Solution Explorer, choosing Add in the menu that appeared, and then choosing New Item.
8282
:::image-end:::
8383

84-
1. In the **Add New Item** dialog box, select **C++ File (.cpp)**. In the **Name** box, type a name for the file, for example, *HelloWindowsDesktop.cpp*. Choose **Add**.
84+
1. In the **Add New Item** dialog box, select **C++ File (.cpp)**. In the **Name** box, type a name for the file, for example, *`HelloWindowsDesktop.cpp`*. Choose **Add**.
8585

8686
:::image type="content" source="../build/media/desktop-app-add-cpp-file-153.png" alt-text="Screenshot of the Add New Item dialog box in Visual Studio 2017. Visual C plus plus is selected on the left and the C plus plus File option is highlighted.":::
8787

@@ -113,7 +113,7 @@ Your project is now created and your source file is opened in the editor.
113113
The animation shows right-clicking on the project name in Solution Explorer, choosing Add in the menu that appears, and then choosing New Item.
114114
:::image-end:::
115115

116-
1. In the **Add New Item** dialog box, select **C++ File (.cpp)**. In the **Name** box, type a name for the file, for example, *HelloWindowsDesktop.cpp*. Choose **Add**.
116+
1. In the **Add New Item** dialog box, select **C++ File (.cpp)**. In the **Name** box, type a name for the file, for example, *`HelloWindowsDesktop.cpp`*. Choose **Add**.
117117

118118
:::image type="content" source="../build/media/desktop-app-add-cpp-file-150.png" alt-text="Screenshot of the Add New Item dialog box in Visual Studio 2015 with Visual C plus plus selected and the C plus plus File option highlighted.":::
119119

@@ -435,7 +435,7 @@ As promised, the complete code for the working application follows.
435435
436436
### To build this example
437437
438-
1. Delete all the code in *HelloWindowsDesktop.cpp* in the editor. Copy this example code and paste it into *HelloWindowsDesktop.cpp*:
438+
1. Delete all the code in *`HelloWindowsDesktop.cpp`* in the editor. Copy this example code and paste it into *`HelloWindowsDesktop.cpp`*:
439439
440440
```cpp
441441
// HelloWindowsDesktop.cpp

0 commit comments

Comments
 (0)