Visual C++ For Linux
Written by Mike James   
Tuesday, 05 April 2016

Another one of those "the world has gone mad" announcements at Build is that now Visual Studio supports C++ development for Linux. As always with this sort of development, the question is why?


Visual Studio has seen some big changes recently; no longer is it just an IDE for Microsoft languages, and now it is no longer an IDE just for Windows.

The move to Linux development isn't the first move beyond Windows, however. Android projects were recently introduced and this allowed Visual Studio programmers to work in C/C++ and Java. Of course, Android is based on Linux so this was the first introduction of Linux programming in Visual Studio. 

Now we have a Visual Studio extension that allows you to create full Linux applications. There is currently a dependency on the Android Tools for VS, and so you have to install these first, but this will change.

The new extension currently only support a remote build configuration, which means that the Linux machine you are targeting actually does the compilation, linking and running of your code. To make this possible Visual Studio needs to be able to communicate with the remote machine using SSH and this means that you need to install openssh if it isn't already installed. If the Linux machine doesn't already have them. it also needs g++, the GNU C++ compiler,  gdb and gdbserver the GNU debugger. 

Once the extension is installed there are templates for a console application and for a Raspberry Pi IoT app. This gives you a clue as to why Linux development has been added to Visual Studio. The Raspberry Pi has become so important that being able to create programs for it is a must. 




For Raspberry Pi development you can currently use NetBeans or Eclipse to do remote build. NetBeans is particularly sophisticated in that it will make use of a remote build host by copying files using SFTP or by file sharing.

At the moment Visual Studio only works using SFTP to copy the files on the Windows machine to the Linux machine, where they are then compiled, linked and run. 




If you are working with a Raspberry Pi  2 or 3 it is also worth knowing that you can run NetBeans on the Pi fast enough not to need a desktop machine. 

As well as IoT applications, you can also create console apps and desktop apps, as long as you remember to include references to any libraries you are using. 

At the moment there are some bugs that need to be ironed out, but if you can get it working you can use Visual Studio to create programs on your desktop Windows machine that can be compiled and run on a remote Linux machine.

This initial release doesn't support running programs on the recently announced Ubuntu system under Windows and it isn't integrated with Azure. However both features are more a matter of configuration than anything completely new, so they should be possible. 

Why has this been added to Visual Studio?

Quite simply because many Microsoft programmers are forced to work with Linux systems either because of the IoT - most single board machines run Linux, or because of the need to work with Linux servers. 


More Information

Visual C++ for Linux Development

Related Articles

Visual Studio "VS 15" Preview Released 

Microsoft Visual Studio Dev Essentials 

Visual Studio V Android Studio 

Raspberry Pi And The IoT In C



To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on, Twitter, FacebookGoogle+ or Linkedin



Falco On Track To Version 1.0.0

Falco is a cloud native runtime security tool for the Linux operating system, designed to detect abnormal behavior and warn of potential security threats in real-time. Now it's about to release its fi [ ... ]

Rust Twice As Productive As C++

Google director of engineering, Lars Bergstrom, gave a talk at the recent Rust Nation UK conference and claimed that Rust was twice as productive as C++. Given how good Google is at C++, this is quite [ ... ]

More News


raspberry pi books



or email your comment to:

Last Updated ( Wednesday, 06 April 2016 )