Our Blogs

Working with Visual C++ for Linux in Visual Studio 2015

October 10, 2016
With the release of Visual Studio 2015, the development of custom applications using Linux has become extremely easier. The Visual C++ for Linux extension provides an ability for Visual Studio 2015 users to write C or C++ code in Visual Studio 2016. After that they can deploy the code to a Linux-based system for the purpose of compilation and debugging. 

In this scenario, the relevant source code and project files are transferred via SSH to the remote machine. The output of the program is displayed from within Visual Studio.

Marc Goodner of Microsoft has released details of the new release 1.0.5, which mainly focuses on new options in the areas such as makefile project template, remote source copy management, overridable C/C++ compiler path and new debugging options.

Makefile project template

This template helps you to make use of an existing build system such as make, CMake on the remote machine and link it in your Visual Studio 2015 project's property settings. The process will work out like this

(1) Edit code in Visual Studio 2015
(2) Prompt Visual Studio 2015 to start the build
(3) Call the existing build system for compilation
(4) Debug the resulting program in Visual Studio

You should note that there is no granular control regarding whether the source files are copied to the remote machine. You  should transfer files for a build that can then be  configured at the file or project level.  

You can also make use of a configuration option that provides the ability to specify which compiler(s) should be used. This will enable you to pick a choice from clang or a specific compiler version needed for the project. 
As a final step, the debugger can be provided additional command line arguments to enable debugging mode. You can modify the debugging mode but it will be useful only for situations where the local machine running Windows does not have a suitable version of gdb.

You can download Visual C++ for Linux extension at the Visual Studio gallery. You can also navigate the project page hosted on GitHub.