Skip to content

Commit 73febb8

Browse files
Merge pull request #5063 from MicrosoftDocs/main638554518255426586sync_temp
For protected branch, push strategy should use PR and merge to target branch method to work around git push error
2 parents fec0a05 + b55ae0a commit 73febb8

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

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

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@
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: 07/05/2023
5+
ms.date: 06/28/2024
66
ms.topic: "tutorial"
77
ms.devlang: "cpp"
88
---
99
# Build and run a C++ console app project
1010

11-
You've created a C++ console app project and entered your code. Now you can build and run it within Visual Studio. Then, run it as a stand-alone app from the command line.
11+
In [Create a C++ console app project](vscpp-step-1-create.md) you created a C++ console app project and entered your code. Now you can build and run it within Visual Studio. Then, run it as a stand-alone app from the command line.
1212

1313
## Prerequisites
1414

1515
- Have Visual Studio with the Desktop development with C++ workload installed and running on your computer. If it's not installed, follow the steps in [Install C++ support in Visual Studio](vscpp-step-0-installation.md).
16-
1716
- 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).
1817

1918
If Visual Studio looks like this, you're ready to build and run your app:
@@ -24,11 +23,11 @@ If Visual Studio looks like this, you're ready to build and run your app:
2423

2524
## Build and run your code in Visual Studio
2625

27-
1. To build your project, choose **Build Solution** from the **Build** menu. The **Output** window shows the results of the build process.
26+
1. To build your project, from the main menu choose **Build** > **Build Solution**. The **Output** window shows the results of the build process.
2827

2928
:::image type="complex" source="media/vscpp-build-solution.gif" alt-text="Animated screenshot showing the sequence of actions taken to build a project in Visual Studio.":::
3029
First, Build is selected from the main menu. Then Build Solution is selected. The Output window shows the build output messages, including that the build is successful.
31-
:::image-end:::
30+
:::image-end:::
3231

3332
1. To run the code, on the menu bar, choose **Debug**, **Start without debugging**.
3433

@@ -38,7 +37,7 @@ If Visual Studio looks like this, you're ready to build and run your app:
3837

3938
A console window opens and then runs your app. When you start a console app in Visual Studio, it runs your code, then prints "Press any key to continue . . ." to give you a chance to see the output.
4039

41-
Congratulations! You've created your first "Hello, world!" console app in Visual Studio! Press a key to dismiss the console window and return to Visual Studio.
40+
Congratulations! You created your first "Hello, world!" console app in Visual Studio! Press a key to dismiss the console window and return to Visual Studio.
4241

4342
[I ran into a problem.](#build-and-run-your-code-in-visual-studio-issues)
4443

@@ -50,12 +49,12 @@ Normally, you run console apps at the command prompt, not in Visual Studio. Once
5049

5150
::: moniker range="<msvc-170"
5251

53-
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.
52+
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. If you see `HelloWorld.exe.recipe`, it's because you did the **Open Folder in File Explorer** step on the HelloWorld *project* instead of the HelloWorld *solution*. Navigate up a level in File Explorer to get to the solution folder. This folder also contains a `Debug` folder, where `HelloWorld.exe` is.
5453

5554
::: moniker-end
5655
::: moniker range=">=msvc-170"
5756

58-
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.
57+
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. If you see `HelloWorld.exe.recipe`, it's because you did the **Open Folder in File Explorer** step on the HelloWorld *project* instead of the HelloWorld *solution*. Navigate up a level in File Explorer to get to the solution folder. This folder also contains a `x64\Debug\` folder, where `HelloWorld.exe` is.
5958

6059
::: moniker-end
6160

@@ -73,7 +72,7 @@ Congratulations, you built and ran a console app in Visual Studio!
7372

7473
## Next Steps
7574

76-
Once you've built and run this simple app, you're ready for more complex projects. For more information, see [Using the Visual Studio IDE for C++ Desktop Development](../ide/using-the-visual-studio-ide-for-cpp-desktop-development.md). It has more detailed walkthroughs that explore the capabilities of Microsoft C++ in Visual Studio.
75+
Once you build and run this simple app, you're ready for more complex projects. For more information, see [Using the Visual Studio IDE for C++ Desktop Development](../ide/using-the-visual-studio-ide-for-cpp-desktop-development.md). It has more detailed walkthroughs that explore the capabilities of Microsoft C++ in Visual Studio.
7776

7877
## Troubleshooting guide
7978

@@ -89,14 +88,14 @@ If red squiggles appear under anything in the source code editor, the build may
8988

9089
::: moniker range="<msvc-170"
9190

92-
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, where your app is.
91+
If the path shown in File Explorer ends in `\HelloWorld\HelloWorld`, you opened the HelloWorld *project* instead of the HelloWorld *solution*. You won't see your app in th `Debug` folder. 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, where your app is.
9392

9493
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.
9594

9695
::: moniker-end
9796
::: moniker range=">=msvc-170"
9897

99-
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, where your app is.
98+
If the path shown in File Explorer ends in `\HelloWorld\HelloWorld`, you opened the HelloWorld *project* instead of the HelloWorld *solution*. You won't see your app in the `x64\Debug` folder. 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, where your app is.
10099

101100
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.
102101

docs/overview/visual-cpp-language-conformance.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -530,8 +530,8 @@ A group of papers listed together indicates a Standard feature along with one or
530530
| &emsp;Alignment specifiers `<stdalign.h>` | VS 2019 16.8 <sup>[C11](#note_C11), [2104](#note_2104)</sup> |
531531
| &emsp;`aligned_alloc` | No <sup>[M](#note_M)</sup> |
532532
| &emsp;No return specifiers `<stdnoreturn.h>` | VS 2019 16.8 <sup>[C11](#note_C11), [2104](#note_2104)</sup> |
533-
| &emsp;Threading support `<threads.h>` | No |
534-
| &emsp;Atomic support `<stdatomic.h>` | No |
533+
| &emsp;Threading support `<threads.h>` | yes |
534+
| &emsp;Atomic support `<stdatomic.h>` | experimental |
535535
| &emsp;`char16_t`, `char32_t` `<uchar.h>` | VS 2019 16.8 <sup>[C11](#note_C11)</sup> |
536536
| &emsp;`gets()` removed | VS 2019 16.8 <sup>[C11](#note_C11), [N](#note_N)</sup> |
537537
| &emsp;`gets_s()` | VS 2019 16.8 <sup>[C11](#note_C11)</sup> |
@@ -541,6 +541,7 @@ A group of papers listed together indicates a Standard feature along with one or
541541
| &emsp;`quick_exit` | VS 2019 16.8 <sup>[C11](#note_C11)</sup> |
542542
| &emsp;`<complex.h>` macros | VS 2019 16.8 <sup>[C11](#note_C11)</sup> |
543543
| &emsp;floating point characteristics `<float.h>` | VS 2019 16.8 <sup>[C11](#note_C11)</sup> |
544+
| &emsp;C11 threads `<threads.h>` | VS 2022 17.8 <sup>[C11](#note_C11)</sup> |
544545

545546
### Supported values
546547

@@ -576,7 +577,7 @@ A group of papers listed together indicates a Standard feature along with one or
576577

577578
<a name="note_A"></a> **A** In [`/std:c++14`](../build/reference/std-specify-language-standard-version.md) mode, dynamic exception specifications remain unimplemented, and `throw()` is still treated as a synonym for `__declspec(nothrow)`. In C++17, dynamic exception specifications were mostly removed by P0003R5, except for one vestige: `throw()` is deprecated and required to behave as a synonym for **`noexcept`**. In [`/std:c++17`](../build/reference/std-specify-language-standard-version.md) mode, MSVC now conforms to the Standard by giving `throw()` the same behavior as **`noexcept`**, that is, enforcement via termination.
578579

579-
The compiler option [`/Zc:noexceptTypes`](../build/reference/zc-noexcepttypes.md) requests the old behavior of `__declspec(nothrow)`. It's likely that `throw()` will be removed in a future version of C++. To help with migrating code in response to these changes in the Standard and the Microsoft implementation, new compiler warnings for exception specification issues have been added under [`/std:c++17`](../build/reference/std-specify-language-standard-version.md) and [`/permissive-`](../build/reference/permissive-standards-conformance.md).
580+
The compiler option [`/Zc:noexceptTypes`](../build/reference/zc-noexcepttypes.md) requests the old behavior of `__declspec(nothrow)`. It's likely that `throw()` will be removed in a future version of C++. To help with migrating code in response to these changes in the Standard and the Microsoft implementation, new compiler warnings for exception specification issues are added under [`/std:c++17`](../build/reference/std-specify-language-standard-version.md) and [`/permissive-`](../build/reference/permissive-standards-conformance.md).
580581

581582
<a name="note_B"></a> **B** Supported in [`/permissive-`](../build/reference/permissive-standards-conformance.md) mode in Visual Studio 2017 version 15.7. For more information, see [`Two-phase name lookup support comes to MSVC`](https://devblogs.microsoft.com/cppblog/two-phase-name-lookup-support-comes-to-msvc/).
582583

0 commit comments

Comments
 (0)