Skip to content

Commit 9f50c59

Browse files
author
Colin Robertson
authored
Merge pull request MicrosoftDocs#2054 from MicrosoftDocs/master637214455467322477
Fix git push error for protected CLA branch
2 parents af07ce2 + 30294ff commit 9f50c59

12 files changed

+52
-39
lines changed

docs/_breadcrumb/toc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
topicHref: /cpp/data/odbc/open-database-connectivity-odbc
8888
- name: Edit, navigate, and refactor code
8989
tocHref: /cpp/ide
90-
topicHref: /cpp/overview-of-cpp-development
90+
topicHref: /cpp/ide/read-and-understand-code-cpp
9191
items:
9292
- name: IDE
9393
tocHref: /cpp/ide/

docs/build/reference/sourcelink.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: "/SOURCELINK (Include Sourcelink file in PDB)"
3-
ms.date: "08/20/2018"
3+
description: "Reference guide to the /SOURCELINK linker option in Microsoft C++."
4+
ms.date: "03/31/2020"
45
f1_keywords: ["/sourcelink"]
56
helpviewer_keywords: ["/SOURCELINK linker option", "/SOURCELINK"]
67
---
@@ -10,28 +11,28 @@ Specifies a Source Link configuration file to include in the PDB file generated
1011

1112
## Syntax
1213

13-
> **/SOURCELINK:**_filename_
14+
> **`/SOURCELINK:`**_`filename`_
1415
1516
## Arguments
1617

1718
*filename*<br/>
18-
Specifies a JSON-formatted configuration file that contains a simple mapping of local file paths to URLs where the source file can be retrieved for display by the debugger. For more information on the format of this file, see [Source Link JSON Schema](https://github.com/dotnet/designs/blob/master/accepted/diagnostics/source-link.md#source-link-json-schema).
19+
Specifies a JSON-formatted configuration file that contains a simple mapping of local file paths to URLs for source files to display in the debugger. For more information on the format of this file, see [Source Link JSON Schema](https://github.com/dotnet/designs/blob/master/accepted/2020/diagnostics/source-link.md#source-link-json-schema).
1920

2021
## Remarks
2122

22-
Source Link is a language- and source-control agnostic system for providing source debugging for binaries. Source Link is supported for native C++ binaries starting in Visual Studio 2017 version 15.8. For an overview of Source Link, see [Source Link](https://github.com/dotnet/designs/blob/master/accepted/diagnostics/source-link.md). For information on how to use Source Link in your projects and how to generate the SourceLink file as part of your project, see [Using Source Link](https://github.com/dotnet/sourcelink#using-source-link-in-c-projects).
23+
Source Link is a language- and source-control agnostic system for providing source debugging for binaries. Source Link is supported for native C++ binaries starting in Visual Studio 2017 version 15.8. For an overview of Source Link, see [Source Link](https://github.com/dotnet/designs/blob/master/accepted/2020/diagnostics/source-link.md). For information on how to use Source Link in your projects, and how to generate the SourceLink file as part of your project, see [Using Source Link](https://github.com/dotnet/sourcelink#using-source-link-in-c-projects).
2324

2425
### To set the /SOURCELINK linker option in Visual Studio
2526

2627
1. Open the **Property Pages** dialog box for the project. For more information, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
2728

2829
1. Select the **Configuration Properties** > **Linker** > **Command Line** property page.
2930

30-
1. In the **Additional options** box, add **/SOURCELINK:**_filename_ and then choose **OK** or **Apply** to save your changes.
31+
1. In the **Additional options** box, add **`/SOURCELINK:`**_`filename`_ and then choose **OK** or **Apply** to save your changes.
3132

3233
### To set this linker option programmatically
3334

34-
- This option does not have a programmatic equivalent.
35+
- This option doesn't have a programmatic equivalent.
3536

3637
## See also
3738

docs/build/walkthrough-compiling-a-native-cpp-program-on-the-command-line.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,27 @@
22
title: "Walkthrough: Compiling a Native C++ Program on the Command Line"
33
description: "Use the Microsoft C++ compiler from a command prompt."
44
ms.custom: "conceptual"
5-
ms.date: "04/23/2019"
5+
ms.date: "04/02/2020"
66
helpviewer_keywords: ["native code [C++]", "Visual C++, native code", "compiling programs [C++]", "command-line applications [C++], native"]
77
ms.assetid: b200cfd1-0440-498f-90ee-7ecf92492dc0
88
---
99
# Walkthrough: Compiling a Native C++ Program on the Command Line
1010

11-
Visual Studio includes a command-line C++ compiler that you can use to create everything from basic console apps to Universal Windows Platform apps, Desktop apps, device drivers, and .NET components.
11+
Visual Studio includes a command-line C and C++ compiler. You can use it to create everything from basic console apps to Universal Windows Platform apps, Desktop apps, device drivers, and .NET components.
1212

1313
In this walkthrough, you create a basic, "Hello, World"-style C++ program by using a text editor, and then compile it on the command line. If you'd like to try the Visual Studio IDE instead of using the command line, see [Walkthrough: Working with Projects and Solutions (C++)](../ide/walkthrough-working-with-projects-and-solutions-cpp.md) or [Using the Visual Studio IDE for C++ Desktop Development](../ide/using-the-visual-studio-ide-for-cpp-desktop-development.md).
1414

15-
In this walkthrough, you can use your own Visual C++ program instead of typing the one that's shown, or you can use a Visual C++ code sample from another help article.
15+
In this walkthrough, you can use your own C++ program instead of typing the one that's shown. Or, you can use a C++ code sample from another help article.
1616

1717
## Prerequisites
1818

1919
To complete this walkthrough, you must have installed either Visual Studio and the optional **Desktop development with C++** workload, or the command-line Build Tools for Visual Studio.
2020

21-
Visual Studio is a powerful integrated development environment (IDE) that supports a full-featured editor, resource managers, debuggers, and compilers for many languages and platforms. For information on how to download and install Visual Studio, including the free Visual Studio Community edition, and to include support for C/C++ development, see [Install C++ support in Visual Studio](vscpp-step-0-installation.md).
21+
Visual Studio is an *integrated development environment* (IDE). It supports a full-featured editor, resource managers, debuggers, and compilers for many languages and platforms. Versions available include the free Visual Studio Community edition, and all can support C and C++ development. For information on how to download and install Visual Studio, see [Install C++ support in Visual Studio](vscpp-step-0-installation.md).
2222

2323
The Build Tools for Visual Studio installs only the command-line compilers, tools, and libraries you need to build C and C++ programs. It's perfect for build labs or classroom exercises and installs relatively quickly. To install only the command-line tools, look for Build Tools for Visual Studio on the [Visual Studio Downloads](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2019) page.
2424

25-
Before you can build a C or C++ program on the command line, you must verify that the tools are installed, and that you can access them from the command line. Visual C++ has complex requirements for the command-line environment to find the tools, headers, and libraries it uses. **You can't use Visual C++ in a plain command prompt window** without doing some preparation. Fortunately, Visual C++ installs shortcuts for you to launch a developer command prompt that has the environment set up for command line builds. Unfortunately, the names of the developer command prompt shortcuts and where they're located are different in almost every version of Visual C++ and on different versions of Windows. Your first walkthrough task is finding the right one to use.
25+
Before you can build a C or C++ program on the command line, verify that the tools are installed, and you can access them from the command line. Visual C++ has complex requirements for the command-line environment to find the tools, headers, and libraries it uses. **You can't use Visual C++ in a plain command prompt window** without doing some preparation. Fortunately, Visual C++ installs shortcuts for you to launch a developer command prompt that has the environment set up for command line builds. Unfortunately, the names of the developer command prompt shortcuts and where they're located are different in almost every version of Visual C++ and on different versions of Windows. Your first walkthrough task is finding the right one to use.
2626

2727
> [!NOTE]
2828
> A developer command prompt shortcut automatically sets the correct paths for the compiler and tools, and for any required headers and libraries. You must set these environment values yourself if you use a regular **Command Prompt** window. For more information, see [Set the Path and Environment Variables for Command-Line Builds](setting-the-path-and-environment-variables-for-command-line-builds.md). We recommend you use a developer command prompt shortcut instead of building your own.
@@ -45,12 +45,12 @@ Before you can build a C or C++ program on the command line, you must verify tha
4545
usage: cl [ option... ] filename... [ /link linkoption... ]
4646
```
4747

48-
There may be differences in the current directory or version numbers, depending on the version of Visual C++ and any updates installed. If the above output is similar to what you see, then you're ready to build C or C++ programs at the command line.
48+
There may be differences in the current directory or version numbers. These values depend on the version of Visual C++ and any updates installed. If the above output is similar to what you see, then you're ready to build C or C++ programs at the command line.
4949

5050
> [!NOTE]
51-
> If you get an error such as "'cl' is not recognized as an internal or external command, operable program or batch file," error C1034, or error LNK1104 when you run the **cl** command, then either you are not using a developer command prompt, or something is wrong with your installation of Visual C++. You must fix this issue before you can continue.
51+
> If you get an error such as "'cl' is not recognized as an internal or external command, operable program or batch file," error C1034, or error LNK1104 when you run the **`cl`** command, then either you are not using a developer command prompt, or something is wrong with your installation of Visual C++. You must fix this issue before you can continue.
5252
53-
If you can't find the developer command prompt shortcut, or if you get an error message when you enter `cl`, then your Visual C++ installation may have a problem. Try reinstalling the Visual C++ component in Visual Studio, or reinstall the Microsoft Visual C++ Build Tools. Don't go on to the next section until this works. For more information about installing and troubleshooting Visual C++, see [Install Visual Studio](/visualstudio/install/install-visual-studio).
53+
If you can't find the developer command prompt shortcut, or if you get an error message when you enter `cl`, then your Visual C++ installation may have a problem. Try reinstalling the Visual C++ component in Visual Studio, or reinstall the Microsoft Visual C++ Build Tools. Don't go on to the next section until the **`cl`** command works. For more information about installing and troubleshooting Visual C++, see [Install Visual Studio](/visualstudio/install/install-visual-studio).
5454

5555
> [!NOTE]
5656
> Depending on the version of Windows on the computer and the system security configuration, you might have to right-click to open the shortcut menu for the developer command prompt shortcut and then choose **Run as administrator** to successfully build and run the program that you create by following this walkthrough.
@@ -97,7 +97,7 @@ Before you can build a C or C++ program on the command line, you must verify tha
9797
9898
```
9999

100-
The dates and other details will differ on your computer. If you don't see your source code file, hello.cpp, make sure you've changed to the c:\hello directory you created, and in Notepad, make sure that you saved your source file in this directory. Also make sure that you saved the source code with a .cpp file name extension, not a .txt extension.
100+
The dates and other details will differ on your computer. If you don't see your source code file, *hello.cpp*, make sure you've changed to the *c:\\hello* directory you created. In Notepad, make sure that you saved your source file in this directory. Also make sure that you saved the source code with a *`.cpp`* file name extension, not a *`.txt`* extension.
101101

102102
1. At the developer command prompt, enter `cl /EHsc hello.cpp` to compile your program.
103103

@@ -134,15 +134,15 @@ Before you can build a C or C++ program on the command line, you must verify tha
134134

135135
## Next steps
136136

137-
This "Hello, World" example is about as simple as a C++ program can get. Real world programs have header files and more source files, link in libraries, and do useful work.
137+
This "Hello, World" example is about as simple as a C++ program can get. Real world programs usually have header files, more source files, and link to libraries.
138138

139-
You can use the steps in this walkthrough to build your own C++ code instead of typing the sample code shown. You can also build many C++ code sample programs that you find elsewhere. You can put your source code and build your apps in any writeable directory. By default, the Visual Studio IDE creates projects in your Documents folder, in a Projects subfolder of a Visual Studio folder named for your version of Visual Studio.
139+
You can use the steps in this walkthrough to build your own C++ code instead of typing the sample code shown. These steps also let you build many C++ code sample programs that you find elsewhere. You can put your source code and build your apps in any writeable directory. By default, the Visual Studio IDE creates projects in your user folder, in a *source\\repos* subfolder. Older versions may put projects in a *Documents\\Visual Studio \<version>\\*Projects* folder.
140140

141141
To compile a program that has additional source code files, enter them all on the command line, like:
142142

143143
`cl /EHsc file1.cpp file2.cpp file3.cpp`
144144

145-
The `/EHsc` command-line option instructs the compiler to enable C++ exception handling. For more information, see [/EH (Exception Handling Model)](reference/eh-exception-handling-model.md).
145+
The `/EHsc` command-line option instructs the compiler to enable standard C++ exception handling behavior. Without it, thrown exceptions can result in undestroyed objects and resource leaks. For more information, see [/EH (Exception Handling Model)](reference/eh-exception-handling-model.md).
146146

147147
When you supply additional source files, the compiler uses the first input file to create the program name. In this case, it outputs a program called file1.exe. To change the name to program1.exe, add an [/out](reference/out-output-file-name.md) linker option:
148148

@@ -152,13 +152,13 @@ And to catch more programming mistakes automatically, we recommend you compile b
152152

153153
`cl /W4 /EHsc file1.cpp file2.cpp file3.cpp /link /out:program1.exe`
154154

155-
The compiler, cl.exe, has many more options you can apply to build, optimize, debug, and analyze your code. For a quick list, enter `cl /?` at the developer command prompt. You can also compile and link separately and apply linker options in more complex build scenarios. For more information on compiler and linker options and usage, see [C/C++ Building Reference](reference/c-cpp-building-reference.md).
155+
The compiler, cl.exe, has many more options. You can apply them to build, optimize, debug, and analyze your code. For a quick list, enter `cl /?` at the developer command prompt. You can also compile and link separately and apply linker options in more complex build scenarios. For more information on compiler and linker options and usage, see [C/C++ Building Reference](reference/c-cpp-building-reference.md).
156156

157-
You can use NMAKE and makefiles, or MSBuild and project files to configure and build more complex projects on the command line. For more information on using these tools, see [NMAKE Reference](reference/nmake-reference.md) and [MSBuild](msbuild-visual-cpp.md).
157+
You can use NMAKE and makefiles, MSBuild and project files, or CMake, to configure and build more complex projects on the command line. For more information on using these tools, see [NMAKE Reference](reference/nmake-reference.md), [MSBuild](msbuild-visual-cpp.md), and [CMake projects in Visual Studio](cmake-projects-in-visual-studio.md).
158158

159-
The C and C++ languages are similar, but not the same. The MSVC compiler uses a simple rule to determine which language to use when it compiles your code. By default, the MSVC compiler treats all files that end in .c as C source code, and all files that end in .cpp as C++ source code. To force the compiler to treat all files as C++ non-dependent on file name extension, use the [/TP](reference/tc-tp-tc-tp-specify-source-file-type.md) compiler option.
159+
The C and C++ languages are similar, but not the same. The MSVC compiler uses a simple rule to determine which language to use when it compiles your code. By default, the MSVC compiler treats files that end in *`.c`* as C source code, and files that end in *`.cpp`* as C++ source code. To force the compiler to treat all files as C++ independent of file name extension, use the [/TP](reference/tc-tp-tc-tp-specify-source-file-type.md) compiler option.
160160

161-
The MSVC compiler includes a C Runtime Library (CRT) that is compatible with the ISO C99 standard, but not strictly compliant. In most cases, portable code will compile and run as expected. Visual C++ doesn't support some of the CRT changes in ISO C11. Certain library functions and POSIX function names are deprecated by the MSVC compiler. The functions are supported, but the preferred names have changed. For more information, see [Security Features in the CRT](../c-runtime-library/security-features-in-the-crt.md) and [Compiler Warning (level 3) C4996](../error-messages/compiler-warnings/compiler-warning-level-3-c4996.md).
161+
The MSVC compiler includes a C Runtime Library (CRT) that conforms to the ISO C99 standard, with minor exceptions. Portable code generally compiles and runs as expected. Certain obsolete library functions, and several POSIX function names, are deprecated by the MSVC compiler. The functions are supported, but the preferred names have changed. For more information, see [Security Features in the CRT](../c-runtime-library/security-features-in-the-crt.md) and [Compiler Warning (level 3) C4996](../error-messages/compiler-warnings/compiler-warning-level-3-c4996.md).
162162

163163
## See also
164164

docs/cppcx/interfaces-c-cx.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ When a ref class implements multiple interfaces, and those interfaces have metho
5757

5858
## Generic interfaces
5959

60-
In C++/CX, the `generic` keyword is used to represent a Windows Runtime parameterized type. A parameterized type is emitted in metadata and can be consumed by code that's written in any language that supports type parameters. The Windows Runtime defines some generic interfaces—for example, [Windows::Foundation::Collections::IVector\<T>](Windows::Foundation::Collections::IVector)—but it doesn't support the creation of public user-defined generic interfaces in C++/CX. However, you can create private generic interfaces.
60+
In C++/CX, the `generic` keyword is used to represent a Windows Runtime parameterized type. A parameterized type is emitted in metadata and can be consumed by code that's written in any language that supports type parameters. The Windows Runtime defines some generic interfaces—for example, [Windows::Foundation::Collections::IVector\<T>](/uwp/api/Windows.Foundation.Collections.IVector_T_)—but it doesn't support the creation of public user-defined generic interfaces in C++/CX. However, you can create private generic interfaces.
6161

6262
Here's how Windows Runtime types can be used to author a generic interface:
6363

0 commit comments

Comments
 (0)