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?

vslogo

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. 

 

vslinuxprojects

 

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. 

 

vslnuxedit

 

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. 

vslogo

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

 

Banner


Bun Shell Released
29/02/2024

The developers of the Bun JavaScript runtime have released Bun Shell, a new experimental embedded language and interpreter in Bun that lets you run cross-platform shell scripts in JavaScript and TypeS [ ... ]



GitHub Introduces Code Scanning
26/03/2024

GitHub has announced a public beta of a code scanner that automatically fixes problems. The new feature was announced back in November, but has now moved to public beta status.  


More News

 

raspberry pi books

 

Comments




or email your comment to: comments@i-programmer.info

Last Updated ( Wednesday, 06 April 2016 )