Skip to content

Commit 37fc447

Browse files
Merge pull request #4619 from MicrosoftDocs/main638242613340461002sync_temp
For protected CLA branch, push strategy should use PR and merge to target branch method to work around git push error
2 parents 6856536 + baae489 commit 37fc447

File tree

3 files changed

+50
-26
lines changed

3 files changed

+50
-26
lines changed

docs/build/reference/openmp-enable-openmp-2-0-support.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: "Learn more about: /openmp (Enable OpenMP Support)"
33
title: "/openmp (Enable OpenMP Support)"
4-
ms.date: 04/01/2021
4+
ms.date: 07/05/2023
55
f1_keywords: ["/openmp", "/openmp:experimental", "/openmp:llvm", "VC.Project.VCCLCompilerTool.OpenMP"]
66
helpviewer_keywords: ["/openmp compiler option [C++]", "/openmp:experimental compiler option [C++]", "/openmp:llvm compiler option [C++]", "-openmp compiler option [C++]"]
77
---
@@ -31,11 +31,11 @@ Causes the compiler to process [`#pragma omp`](../../preprocessor/omp.md) direct
3131

3232
::: moniker range=">= msvc-160"
3333

34-
The C++ compiler currently supports the OpenMP 2.0 standard. However, Visual Studio 2019 also now offers SIMD functionality. To use SIMD, compile by using the **`/openmp:experimental`** option. This option enables both the usual OpenMP features, and OpenMP SIMD features not available when using the **`/openmp`** switch.
34+
The C++ compiler currently supports the OpenMP 2.0 standard. Visual Studio 2019 also now offers SIMD functionality. To use SIMD, compile using the **`/openmp:experimental`** option. This option enables both the usual OpenMP features, and OpenMP SIMD features not available when using the **`/openmp`** switch.
3535

3636
Starting in Visual Studio 2019 version 16.9, you can use the experimental **`/openmp:llvm`** option instead of **`/openmp`** to target the LLVM OpenMP runtime. Support currently isn't available for production code, since the required libomp DLLs aren't redistributable. The option supports the same OpenMP 2.0 directives as **`/openmp`**. And, it supports all the SIMD directives supported by the **`/openmp:experimental`** option. It also supports unsigned integer indices in parallel for loops according to the OpenMP 3.0 standard. For more information, see [Improved OpenMP Support for C++ in Visual Studio](https://devblogs.microsoft.com/cppblog/improved-openmp-support-for-cpp-in-visual-studio/).
3737

38-
Currently, the **`/openmp:llvm`** option only works on the x64 architecture. The option isn't compatible with **`/clr`** or **`/ZW`**.
38+
The **`/openmp:llvm`** option supports the x64 architecture. Starting with Visual Studio 2019 version 16.10, it also supports the x86 and ARM64 architectures. This option isn't compatible with **`/clr`** or **`/ZW`**.
3939

4040
::: moniker-end
4141

docs/build/vscpp-step-1-create.md

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,40 @@
22
title: Create a C++ console app project
33
description: "Create a Hello World console app using Microsoft C++ in Visual Studio."
44
ms.custom: "mvc"
5-
ms.date: 04/20/2020
5+
ms.date: 07/05/2023
66
ms.topic: "tutorial"
7-
ms.assetid: 45138d70-719d-42dc-90d7-1d0ca31a2f54
87
---
98
# Create a C++ console app project
109

11-
The usual starting point for a C++ programmer is a "Hello, world!" application that runs on the command line. That's what you'll create in Visual Studio in this step.
10+
The usual starting point for a C++ programmer is a "Hello, world!" application that runs on the command line. That's what you create in Visual Studio in this step.
1211

1312
## Prerequisites
1413

1514
- Have Visual Studio with the Desktop development with C++ workload installed and running on your computer. If it's not installed yet, see [Install C++ support in Visual Studio](vscpp-step-0-installation.md).
1615

1716
## Create your app project
1817

19-
Visual Studio uses *projects* to organize the code for an app, and *solutions* to organize your projects. A project contains all the options, configurations, and rules used to build your apps. It manages the relationship between all the project's files and any external files. To create your app, first, you'll create a new project and solution.
18+
Visual Studio uses *projects* to organize the code for an app, and *solutions* to organize your projects. A project contains all the options, configurations, and rules used to build your apps. It manages the relationship between all the project's files and any external files. To create your app, first, create a new project and solution.
2019

2120
::: moniker range=">=msvc-160"
2221

2322
1. In Visual Studio, open the **File** menu and choose **New > Project** to open the **Create a new Project** dialog. Select the **Console App** template that has **C++**, **Windows**, and **Console** tags, and then choose **Next**.
2423

25-
![Create a new project dialog.](media/vs2019-choose-console-app.png "Open the Create a new project dialog")
24+
:::image type="complex" source="media/vs2019-choose-console-app.png" alt-text="Screenshot of the create a new project dialog.":::
25+
The create a new project dialog with the Console App template selected. That template says: Run code in a windows terminal. Prints hello world by default. Has the tags c++, Windows, and Console.
26+
:::image-end:::
2627

2728
1. In the **Configure your new project** dialog, enter *HelloWorld* in the **Project name** edit box. Choose **Create** to create the project.
2829

29-
![Screenshot of the Configure your new project dialog box with Hello World typed in the Project name text field.](media/vs2019-configure-new-project-hello-world.png "Name and create the new project")
30+
:::image type="complex" source="media/vs2019-configure-new-project-hello-world.png" alt-text="Screenshot of Configure your new project dialog.":::
31+
The Configure your new project dialog with HelloWorld entered into the Project name field.
32+
:::image-end:::
3033

31-
Visual Studio creates a new project. It's ready for you to add and edit your source code. By default, the Console App template fills in your source code with a "Hello World" app:
34+
Visual Studio creates a new project. It's ready for you to add and edit your source code. By default, the Console App template provides source code for a "Hello World" app, like this:
3235

33-
![Screenshot of the Hello World project in the IDE.](media/vs2019-hello-world-code.png "Hello World project in the IDE")
36+
:::image type="complex" source="media/vs2019-hello-world-code.png" alt-text="Screenshot of the NEW Hello World project.":::
37+
Shows the new project. The HelloWorld.cpp file is open, showing the default code that is included with this template. That code consists of #include iostream and a main() function that contains the line: std::cout << quote hello world!\n quote;
38+
:::image-end:::
3439

3540
When the code looks like this in the editor, you're ready to go on to the next step and build your app.
3641

@@ -48,7 +53,7 @@ Visual Studio uses *projects* to organize the code for an app, and *solutions* t
4853

4954
![Screenshot of the New Project dialog box with Installed > Visual C plus plus selected and called out, the Empty Project option called out, and Hello World typed in the Name text box.](media/vscpp-concierge-project-name-callouts.png "Name and create the new project")
5055

51-
Visual Studio creates a new, empty project. It's ready for you to specialize for the kind of app you want to create and to add your source code files. You'll do that next.
56+
Visual Studio creates a new, empty project. It's ready for you to specialize for the kind of app you want to create and to add your source code files. You do that next.
5257

5358
[I ran into a problem.](#create-your-app-project-issues)
5459

@@ -62,7 +67,7 @@ Visual Studio can create all kinds of apps and components for Windows and other
6267

6368
![View of using the Property Pages dialog to set the Subsystem property.](media/vscpp-properties-linker-subsystem.gif "Open the Property Pages dialog")
6469

65-
Visual Studio now knows to build your project to run in a console window. Next, you'll add a source code file and enter the code for your app.
70+
Visual Studio now knows to build your project to run in a console window. Next, you add a source code file and enter the code for your app.
6671

6772
[I ran into a problem.](#make-your-project-a-console-app-issues)
6873

@@ -94,15 +99,15 @@ Visual studio creates a new, empty source code file and opens it in an editor wi
9499
95100
The code should look like this in the editor window:
96101
97-
![Screenshot of the Hello World code in the editor.](media/vscpp-hello-world-editor.png "Hello World code in editor")
102+
![Screenshot of the Hello World code in the editor.](media/vscpp-hello-world-editor.png "The default Hello World code provided by the Console App template project in the IDE. The code consists of #include iostream and a main() function that contains the line: std::cout << \"hello world!\n\"; followed by return 0;")
98103
99104
When the code looks like this in the editor, you're ready to go on to the next step and build your app.
100105
101106
[I ran into a problem.](#add-a-source-code-file-issues)
102107
103108
::: moniker-end
104109
105-
## Next Steps
110+
## Next steps
106111
107112
> [!div class="nextstepaction"]
108113
> [Build and run a C++ project](vscpp-step-2-build.md)
@@ -119,7 +124,7 @@ The **New Project** dialog should show a **Console App** template that has **C++
119124
120125
To install **Desktop development with C++**, you can run the installer right from the **New Project** dialog. Choose the **Install more tools and features** link at the bottom of the template list to start the installer. If the **User Account Control** dialog requests permissions, choose **Yes**. In the installer, make sure the **Desktop development with C++** workload is checked. Then choose **Modify** to update your Visual Studio installation.
121126
122-
If another project with the same name already exists, choose another name for your project. Or, delete the existing project and try again. To delete an existing project, delete the solution folder (the folder that contains the *helloworld.sln* file) in File Explorer.
127+
If another project with the same name already exists, choose another name for your project. Or, delete the existing project and try again. To delete an existing project, delete the solution folder (the folder that contains the `helloworld.sln` file) in File Explorer.
123128
124129
[Go back](#create-your-app-project).
125130
@@ -133,7 +138,7 @@ If the **New Project** dialog doesn't show a **Visual C++** entry under **Instal
133138
134139
::: moniker range="<=msvc-150"
135140
136-
If another project with the same name already exists, choose another name for your project. Or, delete the existing project and try again. To delete an existing project, delete the solution folder (the folder that contains the *helloworld.sln* file) in File Explorer.
141+
If another project with the same name already exists, choose another name for your project. Or, delete the existing project and try again. To delete an existing project, delete the solution folder (the folder that contains the `helloworld.sln` file) in File Explorer.
137142
138143
[Go back](#create-your-app-project).
139144

docs/build/vscpp-step-2-build.md

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
title: Build and run a C++ console app project
33
description: "Build and run a Hello World console app in Visual C++"
44
ms.custom: "mvc"
5-
ms.date: 04/20/2020
5+
ms.date: 07/05/2023
66
ms.topic: "tutorial"
77
ms.devlang: "cpp"
8-
ms.assetid: 45138d71-719d-42dc-90d7-1d0ca31a2f55
98
---
109
# Build and run a C++ console app project
1110

@@ -15,7 +14,7 @@ You've created a C++ console app project and entered your code. Now you can buil
1514

1615
- Have Visual Studio with the Desktop development with C++ workload installed and running on your computer. If it's not installed yet, follow the steps in [Install C++ support in Visual Studio](vscpp-step-0-installation.md).
1716

18-
- Create a "Hello, World!" project and enter its source code. If you haven't done this step yet, follow the steps in [Create a C++ console app project](vscpp-step-1-create.md).
17+
- Create a "Hello, World!" project. By default, it contains code to print `Hello World!`. If you haven't done this step yet, follow the steps in [Create a C++ console app project](vscpp-step-1-create.md).
1918

2019
If Visual Studio looks like this, you're ready to build and run your app:
2120

@@ -39,15 +38,24 @@ Congratulations! You've created your first "Hello, world!" console app in Visual
3938

4039
## Run your code in a command window
4140

42-
Normally, you run console apps at the command prompt, not in Visual Studio. Once your app is built by Visual Studio, you can run it from any command window. Here's how to find and run your new app in a command prompt window.
41+
Normally, you run console apps at the command prompt, not in Visual Studio. Once Visual Studio builds your app, you can run it from a command window. Here's how to find and run your new app in a command prompt window.
4342

4443
1. In **Solution Explorer**, select the HelloWorld solution (not the HelloWorld project) and right-click to open the context menu. Choose **Open Folder in File Explorer** to open a **File Explorer** window in the HelloWorld solution folder.
4544

46-
1. In the **File Explorer** window, open the Debug folder. This folder contains your app, *HelloWorld.exe*, and a couple of other debugging files. Hold down the **Shift** key and right-click on *HelloWorld.exe* to open the context menu. Choose **Copy as path** to copy the path to your app to the clipboard.
45+
::: moniker range="<msvc-170"
4746

48-
1. To open a command prompt window, press **Windows+R** to open the **Run** dialog. Enter *cmd.exe* in the **Open** textbox, then choose **OK** to run a command prompt window.
47+
2. In the **File Explorer** window, open the `Debug` folder. This folder contains your app, `HelloWorld.exe`, and debugging files. Hold down the **Shift** key and right-click on `HelloWorld.exe` to open the context menu. Choose **Copy as path** to copy the path to your app to the clipboard.
4948

50-
1. In the command prompt window, right-click to paste the path to your app into the command prompt. Press Enter to run your app.
49+
::: moniker-end
50+
::: moniker range=">=msvc-170"
51+
52+
2. In the **File Explorer** window, open the `x64` folder and then the `Debug` folder. This folder contains your app, `HelloWorld.exe`, and debugging files. Hold down the **Shift** key and right-click on `HelloWorld.exe` to open the context menu. Choose **Copy as path** to copy the path to your app to the clipboard.
53+
54+
::: moniker-end
55+
56+
3. To open a command prompt window, press **Windows+R** to open the **Run** dialog. Enter *cmd.exe* in the **Open** textbox, then choose **OK** to run a command prompt window.
57+
58+
4. In the command prompt window, right-click to paste the path to your app into the command prompt. Press Enter to run your app.
5159

5260
![View of what happens when you run the app at the command prompt.](media/vscpp-run-in-cmd.gif "Run the app at the command prompt")
5361

@@ -71,9 +79,20 @@ If red squiggles appear under anything in the source code editor, the build may
7179

7280
### Run your code in a command window: issues
7381

74-
If the path shown in File Explorer ends in *\\HelloWorld\\HelloWorld*, you've opened the HelloWorld *project* instead of the HelloWorld *solution*. You'll be confused by a Debug folder that doesn't contain your app. Navigate up a level in File Explorer to get to the solution folder, the first *HelloWorld* in the path. This folder also contains a Debug folder, and you'll find your app there.
82+
::: moniker range="<msvc-170"
83+
84+
If the path shown in File Explorer ends in `\HelloWorld\HelloWorld`, you've opened the HelloWorld *project* instead of the HelloWorld *solution*. You'll be confused by a `Debug` folder that doesn't contain your app. Navigate up a level in File Explorer to get to the solution folder, the first *HelloWorld* in the path. This folder also contains a `Debug` folder, and you'll find your app there.
85+
86+
You can also navigate to the solution `Debug` folder at the command line to run your app. Your app won't run from other directories without specifying the path to the app. However, you can copy your app to another directory and run it from there. It's also possible to copy it to a directory specified by your `PATH` environment variable, then run it from anywhere.
87+
88+
::: moniker-end
89+
::: moniker range=">=msvc-170"
90+
91+
If the path shown in File Explorer ends in `\HelloWorld\HelloWorld`, you've opened the HelloWorld *project* instead of the HelloWorld *solution*. You'll be confused by a `x64\Debug` folder that doesn't contain your app. Navigate up a level in File Explorer to get to the solution folder, the first `HelloWorld` in the path. This folder also contains a `x64\Debug` folder, and you'll find your app there.
92+
93+
You can also navigate to the solution `x64\Debug` folder at the command line to run your app. Your app won't run from other directories without specifying the path to the app. However, you can copy your app to another directory and run it from there. It's also possible to copy it to a directory specified by your `PATH` environment variable, then run it from anywhere.
7594

76-
You can also navigate to the solution Debug folder at the command line to run your app. Your app won't run from other directories without specifying the path to the app. However, you can copy your app to another directory and run it from there. It's also possible to copy it to a directory specified by your PATH environment variable, then run it from anywhere.
95+
::: moniker-end
7796

7897
If you don't see **Copy as path** in the shortcut menu, dismiss the menu, and then hold down the **Shift** key while you open it again. This command is just for convenience. You can also copy the path to the folder from the File Explorer search bar, and paste it into the **Run** dialog, and then enter the name of your executable at the end. It's just a little more typing, but it has the same result.
7998

0 commit comments

Comments
 (0)