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
Copy file name to clipboardExpand all lines: docs/languages/cpp.md
+25-25Lines changed: 25 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ C/C++ support for Visual Studio Code is provided by a [Microsoft C/C++ extension
13
13
## Install the extension
14
14
15
15
1. Open VS Code.
16
-
1. Select the Extensions view icon on the Activity bar or use the keyboard shortcut (`kb(workbench.view.extensions)`).
16
+
1. Select the Extensions view icon on the Activity Bar or use the keyboard shortcut (`kb(workbench.view.extensions)`).
17
17
1. Search for `'C++'`.
18
18
1. Select **Install**.
19
19
@@ -91,21 +91,21 @@ To understand the process, let's install Mingw-w64 via [MSYS2](https://www.msys2
91
91
1. Enter `Y` when prompted whether to proceed with the installation.
92
92
93
93
1. Add the path of your MinGW-w64 `bin` folder to the Windows `PATH` environment variable by using the following steps:
94
-
1. In the Windows search bar, type**Settings** to open your Windows Settings.
95
-
1. Search for**Edit environment variables for your account**.
96
-
1. In your **User variables**, selectthe`Path` variable and thenselect**Edit**.
97
-
1. Select **New** and add the MinGW-w64 destination folder you recorded during the installation process to the list. If you selected the default installation steps, the path is: `C:\msys64\ucrt64\bin`.
98
-
1. Select **OK**, and thenselect**OK** again in the **Environment Variables** window to update the `PATH` environment variable.
99
-
You have to reopen any console windows for the updated `PATH` environment variable to be available.
94
+
1. In the Windows search bar, type**Settings** to open your Windows Settings.
95
+
1. Search for**Edit environment variables for your account**.
96
+
1. In your **User variables**, selectthe`Path` variable and thenselect**Edit**.
97
+
1. Select **New** and add the MinGW-w64 destination folder you recorded during the installation process to the list. If you selected the default installation steps, the path is: `C:\msys64\ucrt64\bin`.
98
+
1. Select **OK**, and thenselect**OK** again in the **Environment Variables** window to update the `PATH` environment variable.
99
+
You have to reopen any console windows for the updated `PATH` environment variable to be available.
100
100
1. Check that your MinGW-w64 tools are correctly installed and available, open a **new** Command Prompt and type:
101
101
102
-
```bash
103
-
gcc --version
104
-
g++ --version
105
-
gdb --version
106
-
```
102
+
```bash
103
+
gcc --version
104
+
g++ --version
105
+
gdb --version
106
+
```
107
107
108
-
You should see output that states which versions of GCC, g++ and GDB you have installed. If this is not the case, make sure your PATH entry matches the Mingw-w64 binary location where the compiler tools are located or reference the [troubleshooting section](/docs/cpp/config-mingw.md#_check-your-mingw-installation).
108
+
You should see output that states which versions of GCC, g++ and GDB you have installed. If this is not the case, make sure your PATH entry matches the Mingw-w64 binary location where the compiler tools are located or reference the [troubleshooting section](/docs/cpp/config-mingw.md#_check-your-mingw-installation).
109
109
110
110
## Create a Hello World App
111
111
@@ -116,19 +116,19 @@ To make sure the compiler is installed and configured correctly, lets create a H
116
116
1. On Windows, launch a Windows command prompt (Enter **Windows command prompt**in the Windows search bar). On macOS and Linux, you can enter these commands in the terminal.
117
117
1. Run the following commands. They are creating an empty folder called `projects` where you can place all your VS Code projects. The next commands create and navigate you to a subfolder called `helloworld`. From there, you are opening `helloworld` directly in VS Code using the `code` command.
118
118
119
-
```bat
120
-
mkdir projects
121
-
cd projects
122
-
mkdir helloworld
123
-
cd helloworld
124
-
code .
125
-
```
119
+
```bat
120
+
mkdir projects
121
+
cd projects
122
+
mkdir helloworld
123
+
cd helloworld
124
+
code .
125
+
```
126
126
127
-
The "code ."command opens VS Code in the current working folder, which becomes your "workspace". Accept the [Workspace Trust](/docs/editing/workspaces/workspace-trust.md) dialog by selecting **Yes, I trust the authors** since this is a folder you created.
127
+
The "code ."command opens VS Code in the current working folder, which becomes your "workspace". Accept the [Workspace Trust](/docs/editing/workspaces/workspace-trust.md) dialog by selecting **Yes, I trust the authors** since this is a folder you created.
128
128
129
-
Now create a new file called `helloworld.cpp` with the **New File** button in the File Explorer or **File**>**New File** command.
129
+
1. Now, create a new file called `helloworld.cpp` with the **New File** button in the File Explorer or **File**>**New File** command.
130
130
131
-

131
+

132
132
133
133
### Add Hello World source code
134
134
@@ -143,7 +143,7 @@ int main()
143
143
}
144
144
```
145
145
146
-
Now press `kb(workbench.action.files.save)` to save the file. You can also enable [AutoSave](/docs/editing/codebasics.md#save-auto-save) to automatically save your file changes, by checking **Auto Save**in the main **File** menu.
146
+
Now press `kb(workbench.action.files.save)` to save the file. You can also enable [AutoSave](/docs/editing/codebasics.md#save--auto-save) to automatically save your file changes, by checking **Auto Save**in the main **File** menu.
147
147
148
148
## Run helloworld.cpp
149
149
@@ -156,7 +156,7 @@ Now press `kb(workbench.action.files.save)` to save the file. You can also enabl
You are only prompted to choose a compiler the first time you run `helloworld.cpp`. This compiler becomes "default" compiler setin your `tasks.json` file.
159
+
You are only prompted to choose a compiler the first time you run `helloworld.cpp`. This compiler becomes "default" compiler setin your `tasks.json` file.
160
160
161
161
4. After the build succeeds, you should see "Hello World" appear in the integrated **Terminal**.
0 commit comments