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/linux/configure-a-linux-project.md
+16-17Lines changed: 16 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
-
title: "Configure a Linux Project | Microsoft Docs"
2
+
title: "Configure a Linux project | Microsoft Docs"
3
3
ms.custom: ""
4
-
ms.date: "11/16/2016"
4
+
ms.date: "11/06/2017"
5
5
ms.reviewer: ""
6
6
ms.suite: ""
7
7
ms.technology: ["cpp-linux"]
@@ -13,29 +13,28 @@ ms.author: "corob"
13
13
manager: "ghogen"
14
14
---
15
15
16
-
# Configure a Linux Project
16
+
# Configure a Linux project
17
17
18
-
## General Settings
19
-
A variety of options can be configured for a Linux project with Visual Studio. To view these options, select the **Project > Properties** menu, or right click on the project in **Solution Explorer** and select **Properties** from the context menu:
18
+
## General settings
19
+
A variety of options can be configured for a Linux project with Visual Studio. To view these options, select the **Project > Properties** menu, or right click on the project in **Solution Explorer** and select **Properties** from the context menu. The **General** settings appear.
By default, an executable (.out) is built with the tool. To build a static or dynamic library, or to use an existing Makefile, use the **Configuration Type** selection.
24
24
25
-
## Remote Settings
26
-
To change settings pertaining to the remote Linux computer, select the **Remote settings**item:
25
+
## Remote settings
26
+
To change settings pertaining to the remote Linux computer, configure the remote options that appear in the **General**settings:
27
27
28
-

28
+
* To change the target Linux computer, use the **Remote Build Machine** entry. This will allow you to select one of the connections created previously. To create a new entry, please see the [Connecting to Your Remote Linux Computer](connect-to-your-remote-linux-computer.md) section.
29
29
30
-
*To change the target Linux computer, use the **Target machine** entry. This will allow you to select one of the connections created previously. To create a new entry, please see the [Connecting to Your Remote Linux Computer](connect-to-your-remote-linux-computer.md) section.
30
+
*The **Remote Build Root Directory** determines the root location of where the project is built on the remote Linux computer. This will default to **~/projects** unless changed.
31
31
32
-
* The **Remote Root Directory**determines the root location of where the project is built on the remote Linux computer. This will default to **~/projects** unless changed.
32
+
* The **Remote Build Project Directory**is where this specific project will be built on the remote Linux computer. This will default to **$(RemoteRootDir)/$(ProjectName)**, which will expand to a directory named after the current project, under the root directory set above.
33
33
34
-
* The **Remote Project Directory** is where this specific project will be built on the remote Linux computer. This will default to **$(RemoteRootDir)/$(ProjectName)**, which will expand to a directory named after the current project, under the root directory set above.
34
+
> [!NOTE]
35
+
> To change the default C and C++ compilers, or the Linker and Archiver used to build the project, use the appropriate entries in the **C/C++ > General** section and the **Linker > General** section. These could be set to use a certain version of GCC, or even the Clang compiler, for example.
35
36
36
-
* Finally, to change the default C and C++ compilers, or the Linker and Archiver used to build the project, use the appropriate entries in the **Tools Defaults** section. These could be set to use a certain version of GCC, or even the Clang compiler, for example.
37
-
38
-
## VC++ Directories
37
+
## VC++ directories
39
38
By default, Visual Studio does not include any system-level include files from the Linux computer. For example, items in the **/usr/include** directory are not present in Visual Studio. For full [IntelliSense](/visualstudio/ide/using-intellisense) support, you will need to copy those files to some location on your development computer and point Visual Studio to this location. One option is to use scp (Secure Copy) to copy the files. On Windows 10, you can use [Bash on Windows](https://msdn.microsoft.com/commandline/wsl/about) to run scp. For previous versions of Windows, you could use something like [PSCP (PuTTY Secure Copy)](http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html).
40
39
41
40
You can copy the files by using a command similar to the following:
@@ -48,7 +47,7 @@ Once the files are copied, use the **VC++ Directories** item in Project properti
When building, the source files on your development PC are copied to the Linux computer and compiled there. By default, all sources in the Visual Studio project are copied to the locations set in the settings above. However, additional sources can also be added to the list, or copying sources can be turned off entirely, which is the default for a Makefile project.
53
52
54
53
***Sources to copy** determines which sources are copied to the remote computer. By default, the **@(SourcesToCopyRemotely)** defaults to all source code files in the project, but does not include any asset/resource files, such as images.
@@ -59,8 +58,8 @@ When building, the source files on your development PC are copied to the Linux c
Since all compilation is happening on a remote computer, several additional Build Events have been added to the Build Events section in Project Properties. These are **Remote Pre-Build Event**, **Remote Pre-Link Event**, and **Remove Post-Build Event**, and will occur on the remote computer before or after the individual steps in the process.
61
+
## Build events
62
+
Since all compilation is happening on a remote computer, several additional Build Events have been added to the Build Events section in Project Properties. These are **Remote Pre-Build Event**, **Remote Pre-Link Event**, and **Remote Post-Build Event**, and will occur on the remote computer before or after the individual steps in the process.
Copy file name to clipboardExpand all lines: docs/linux/connect-to-your-remote-linux-computer.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
-
title: "Connect to Your Remote Linux Computer | Microsoft Docs"
2
+
title: "Connect to your remote Linux computer | Microsoft Docs"
3
3
ms.custom: ""
4
-
ms.date: "11/16/2016"
4
+
ms.date: "11/06/2017"
5
5
ms.reviewer: ""
6
6
ms.suite: ""
7
7
ms.technology: ["cpp-linux"]
@@ -13,7 +13,7 @@ ms.author: "corob"
13
13
manager: "ghogen"
14
14
---
15
15
16
-
# Connect to Your Remote Linux Computer
16
+
# Connect to Your remote Linux computer
17
17
18
18
When building, Linux code is copied to your remote Linux computer and then compiled on that system according to the settings chosen in Visual Studio. To setup this remote connection:
title: "Deploy, Run, and Debug Your Linux Project | Microsoft Docs"
2
+
title: "Deploy, run, and debug Your Linux project | Microsoft Docs"
3
3
ms.custom: ""
4
-
ms.date: "11/16/2016"
4
+
ms.date: "11/06/2017"
5
5
ms.reviewer: ""
6
6
ms.suite: ""
7
7
ms.technology: ["cpp-linux"]
@@ -13,37 +13,66 @@ ms.author: "corob"
13
13
manager: "ghogen"
14
14
---
15
15
16
-
# Deploy, Run, and Debug Your Project
16
+
# Deploy, run, and debug your Linux project
17
17
18
-
Now that the project is created, you will need to connect to your Linux computer, which is where the code will be compiled, executed, and debugged.
19
-
20
-
1. Set the remote target architecture using the standard dropdown in Visual Studio as shown:
21
-

18
+
Once you have created a Linux project and you have connected to the project using the [Linux Connection Manager](../linux/connect-to-your-remote-linux-computer.md), you can run and debug the project. You compile, execute, and debug the code on the remote target.
22
19
23
20
There are several ways to interact with and debug your Linux project.
24
21
25
-
* The traditional Visual Studio features, such as breakpoints, watch windows, and hovering over a variable, will all work as expected, so you may debug as you normally would.
26
-
* A special Linux Console window can be opened with the **Debug > Linux Console** menu item.
22
+
* Debug using traditional Visual Studio features, such as breakpoints, watch windows, and hovering over a variable, so you may debug as you normally would in other project types.
23
+
* View output from the target computer in a special Linux Console window, which you can also use to send input to the target computer.
24
+
25
+
## Debug your Linux project
26
+
27
+
1. Select debugging mode in the **Debugging** property page.
28
+
29
+
GDB is used to debug applications running on Linux. However, this can run in two different modes, which can be selected from the **Debugging Mode** option in the project's **Debugging** property page:
30
+
31
+

32
+
33
+
- In **gdbserver** mode, GDB is run locally which connects to gdbserver running on the remote system. Note that this is the only mode which the Linux Console window supports.
34
+
35
+
- In **gdb** mode, the Visual Studio debugger drives GDB on the remote system, which is more compatible if the local version of GDB is not compatible with the version installed on the target computer. |
36
+
37
+
> [!NOTE]
38
+
> If you are unable to hit breakpoints in gdbserver debugging mode, try gdb mode. gdb must first be [installed](../linux/download-install-and-setup-the-linux-development-workload.md) on the remote target.
39
+
40
+
2. Select the remote target using the standard **Debug** toolbar in Visual Studio.
41
+
42
+
When the remote target is available, you will see it listed by either name or IP address.
43
+
44
+

45
+
46
+
If you have not yet connected to the remote target, you will see an instruction to use [Linux Connection Manager](../linux/connect-to-your-remote-linux-computer.md) to connect to the remote target.
47
+
48
+

49
+
50
+
3. Set a breakpoint by clicking in the left gutter of some code that you know will execut. A red circle appears.
When you start debugging the application first will be compiled on the remote target. Any compilation errors will appear in the **Error List** window.
55
+
56
+
If there are no errors, the app will start and the debugger will pause at the breakpoint.
57
+
58
+

59
+
60
+
Now, you can interact with the application in it's current state, view variables, and step through code by pressing command keys such as **F10** or **F11**.
61
+
62
+
4. If you want to use the Linux Console to interact with your app, select **Debug > Linux Console**.
27
63
28
64

29
65
30
66
This console will display any console output from the target computer as well as take input and send it to the target computer.
31
67
32
68

33
69
70
+
## Configure other debugging options
71
+
34
72
* Command line arguments can be passed to the executable using the **Program Arguments** item in the project's **Debugging** property page.
* GDB is used to debug applications running on Linux. However, this can run in two different modes, which can be selected from the **Debugging Mode** option in the project's **Debugging** property page:
39
-
40
-

41
-
42
-
| Selection | Description
43
-
| --------- | ---
44
-
| gdbserver | GDB is run locally which connects to gdbserver running on the remote system. Note that this is the only mode which the Linux Console window supports.
45
-
| gdb | the Visual Studio debugger drives GDB on the remote system, which is more compatible if the local version of GDB is not compatible with the version installed on the target computer
46
-
47
76
* Specific debugger options can be passed to GDB using the **Additional Debugger Commands** entry. For example, you might want to ignore SIGILL (illegal instruction) signals. You could use the **handle** command to achieve this. by adding the following to the **Additional Debugger Commands** entry as shown above:
Copy file name to clipboardExpand all lines: docs/linux/download-install-and-setup-the-linux-development-workload.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: "Download, Install and Setup the Linux Workload | Microsoft Docs"
2
+
title: "Download, install, and setup the Linux workload | Microsoft Docs"
3
3
ms.custom: ""
4
4
ms.date: "11/16/2016"
5
5
ms.reviewer: ""
@@ -13,16 +13,16 @@ ms.author: "corob"
13
13
manager: "ghogen"
14
14
---
15
15
16
-
# Download, Install and Setup the Linux Workload
16
+
# Download, install, and setup the Linux workload
17
17
18
-
## Visual Studio Setup
18
+
## Visual Studio setup
19
19
1. Start the Visual Studio installer and select the **Linux development with C++** workload.
20
20
21
21

22
22
23
23
2. Click **Install** to continue with the installation.
24
24
25
-
## Linux Setup
25
+
## Linux setup
26
26
The target Linux computer must have **openssh-server**, **g++**, **gdb**, and **gdbserver** installed, and the ssh daemon must be running. If these are not already present, you can install them as follows:
0 commit comments