• Article
  • 2 minutes to check out

Linux tasks are offered in Visual Studio 2017 and later on.

First, make certain you have the Linux Development Workload for Visual Studio set up. To learn more, see Download, set up, and setup the Linux work

For cross-platform collection, we advise utilizing CMake. CMake assistance is more total in Visual Studio2019 If CMake isn’t a choice, and you have an existing Windows Visual Studio service that you want to reach assemble for Linux, you can include a Visual Studio Linux job to the Windows service, in addition to a Shared Items task. Put the code that is shared in between both platforms in the Shared Items job, and include a referral to that job from the Windows and Linux jobs.

To produce a brand-new Linux task

To produce a brand-new Linux job in Visual Studio 2017, follow these actions:

  1. Select File > New Project in Visual Studio, or press Ctrl + Shift + N
  2. Select the Visual C++ > Cross Platform > Linux node, and after that pick the task type to develop. Get in a Name and Location, and pick OKAY

    newproject Cross Platform > Linux picked, all of the task types called out, and the Name and Location text boxes likewise called out.” data-linktype=” relative-path” >

    Project Type Description
    Blink (Raspberry) Project targeted for a Raspberry Pi gadget, with sample code that blinks an LED
    Console Application (Linux) Project targeted for any Linux computer system, with sample code that outputs text to the console
    Empty Project (Linux) Project targeted for any Linux computer system, without any sample code
    Makefile Project (Linux) Project targeted for any Linux computer system, developed utilizing a basic Makefile construct system
First, ensure you have the Linux Development Workload for Visual Studio set up. For additional information, see Download, set up, and established the Linux work

When you produce a brand-new C++ job for Linux in Visual Studio, you can pick to produce a Visual Studio task or a CMake job. This post explains how to develop a Visual Studio task. In basic, for brand-new tasks that may consist of open-source code or you mean to assemble for cross-platform advancement, we suggest you utilize CMake with Visual Studio. With a CMake job, you can develop and debug the very same task on both Windows and Linux. For more details, see Create and set up a Linux CMake Project