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/create-a-new-linux-project.md
+34-19Lines changed: 34 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,33 +12,50 @@ Linux projects are available in Visual Studio 2017 and later.
12
12
13
13
::: moniker-end
14
14
15
-
First, make sure you have the **Linux Development Workload** for Visual Studio installed. For more information, see [Download, install, and setup the Linux workload](download-install-and-setup-the-linux-development-workload.md).
15
+
::: moniker range="vs-2017"
16
16
17
-
When you create a new C++ project for Linux in Visual Studio, you can choose to create a Visual Studio project or a CMake project. This article describes how to create a Visual Studio project. In general, for new projects that might include open-source code or that you intend to compile for cross-platform development, we recommend that you use CMake with Visual Studio. With a CMake project you can build and debug the same project on both Windows and Linux. For more information, see [Create and configure a Linux CMake Project](cmake-linux-project.md).
17
+
First, make sure you have the **Linux Development Workload**for Visual Studio installed. For more information, see [Download, install, and setup the Linux workload](download-install-and-setup-the-linux-development-workload.md).
18
18
19
-
If you have an existing Windows Visual Studio solution that you would like to extend to compile for Linux, and CMake is not an option, then you can add a Visual Studio Linux project to the Windows solution, along with a **Shared Items** project. Put the code that is shared between both platforms in the Shared Items project, and add a reference to that project from the Windows and Linux projects.
19
+
For cross-platform compilation, we recommend using CMake. CMake support is more complete in Visual Studio 2019. If CMake is not an option, and you have an existing Windows Visual Studio solution that you would like to extend to compile for Linux, you can add a Visual Studio Linux project to the Windows solution, along with a **Shared Items** project. Put the code that is shared between both platforms in the Shared Items project, and add a reference to that project from the Windows and Linux projects.
20
20
21
21
## To create a new Linux project
22
22
23
-
To create a new Linux project in Visual Studio, follow these steps:
24
-
25
-
::: moniker range="vs-2019"
23
+
To create a new Linux project in Visual Studio 2017, follow these steps:
26
24
27
25
1. Select **File > New Project** in Visual Studio, or press **Ctrl + Shift + N**.
28
-
1.Set the **Language** to **C++** and search for "Linux". Select the project type to create, and then choose **Next**. Enter a **Name** and **Location**, and choose **Create**.
26
+
1.Select the **Visual C++ > Cross Platform > Linux** node, and then select the project type to create. Enter a **Name** and **Location**, and choose **OK**.
29
27
30
-

28
+

29
+
30
+
| Project Type | Description |
31
+
| ------------ | --- |
32
+
|**Blink (Raspberry)**| Project targeted for a Raspberry Pi device, with sample code that blinks an LED |
33
+
|**Console Application (Linux)**| Project targeted for any Linux computer, with sample code that outputs text to the console |
34
+
|**Empty Project (Linux)**| Project targeted for any Linux computer, with no sample code |
35
+
|**Makefile Project (Linux)**| Project targeted for any Linux computer, built using a standard Makefile build system |
36
+
37
+
## Next steps
38
+
39
+
[Configure a Linux project](configure-a-linux-project.md)
31
40
32
41
::: moniker-end
33
42
34
-
::: moniker range="vs-2017"
43
+
::: moniker range="vs-2019"
35
44
36
-
1. Select **File > New Project** in Visual Studio, or press **Ctrl + Shift + N**.
37
-
1. Select the **Visual C++ > Cross Platform > Linux** node, and then select the project type to create. Enter a **Name** and **Location**, and choose **OK**.
45
+
First, make sure you have the **Linux Development Workload** for Visual Studio installed. For more information, see [Download, install, and setup the Linux workload](download-install-and-setup-the-linux-development-workload.md).
38
46
39
-

47
+
When you create a new C++ project for Linux in Visual Studio, you can choose to create a Visual Studio project or a CMake project. This article describes how to create a Visual Studio project. In general, for new projects that might include open-source code or that you intend to compile for cross-platform development, we recommend that you use CMake with Visual Studio. With a CMake project you can build and debug the same project on both Windows and Linux. For more information, see [Create and configure a Linux CMake Project](cmake-linux-project.md).
40
48
41
-
::: moniker-end
49
+
If you have an existing Windows Visual Studio solution that you would like to extend to compile for Linux, and CMake is not an option, then you can add a Visual Studio Linux project to the Windows solution, along with a **Shared Items** project. Put the code that is shared between both platforms in the Shared Items project, and add a reference to that project from the Windows and Linux projects.
50
+
51
+
## To create a new Linux project
52
+
53
+
To create a new Linux project in Visual Studio 2019, follow these steps:
54
+
55
+
1. Select **File > New Project** in Visual Studio, or press **Ctrl + Shift + N**.
56
+
1. Set the **Language** to **C++** and search for "Linux". Select the project type to create, and then choose **Next**. Enter a **Name** and **Location**, and choose **Create**.
57
+
58
+

42
59
43
60
| Project Type | Description |
44
61
| ------------ | --- |
@@ -47,12 +64,10 @@ To create a new Linux project in Visual Studio, follow these steps:
47
64
|**Empty Project (Linux)**| Project targeted for any Linux computer, with no sample code |
48
65
|**Makefile Project (Linux)**| Project targeted for any Linux computer, built using a standard Makefile build system |
49
66
50
-
::: moniker range="vs-2019"
67
+
## Next steps
51
68
52
-
Visual Studio 2019 enables you to create a new CMake project. For more information, see [Create and configure a Linux CMake Project ](cmake-linux-project.md).
53
-
54
-
::: moniker-end
69
+
[Configure a Linux project](configure-a-linux-project.md)
70
+
71
+
::: moniker-end
55
72
56
-
## Next Steps
57
73
58
-
[Configure a Linux project](configure-a-linux-project.md)
0 commit comments