Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News Writing C++ for Linux on Visual Studio

Writing C++ for Linux on Visual Studio

This item in japanese


Microsoft debuted their Visual Studio 2015 Extension which provides for writing C++ code in VS2015, which can be compiled and executed on Linux/UNIX based systems during Build 2016.  The idea is simple: write and develop C++ code using Visual Studio 2015 and then deploy that code to a remote machine running Linux for compilation and debugging. 

The extension works by communicating over SSH from the development machine running Windows to the remote machine running the g++ compiler.  This means that while the extension bills itself as though “for Linux”, it can in fact run on Linux as well as other UNIX based operating systems including FreeBSD, and Mac OS X.  This also means that devices like the Raspberry Pi and the Intel Edison board are also supported, a boon to Windows-based developers targeting those devices.

New in the extension's latest 1.0.3 release is the addition of a console window to Visual Studio which provides the ability to interact with your project's remote executables.  The window supports both viewing your program's output and entering input (input is limited to console-style command entry; mouse or other input method is not supported).

As for my Windows 10 machine, the process was very straightforward:  install the extension, load VS2015, create a new Console Application targeting Linux, enter login credentials for the Linux machine, and start compiling code.  The extension used the g++ compiler on my Linux machine (running Debian) to compile the project, and I was able to view the results of both the compilation and the program's execution on the new Linux Console Window.  When I looked at the remote account on the Linux machine, I could see that a new directory was created in my home directory called “projects” and within it was a subdirectory with the name of my VS2015 project that contained the project's source code.

Microsoft’s Marc Goodner has compiled a list describing all the changes made for this release, as well as the bug fixes.  Among the more notable fixes is support for the use of command line arguments on the remote executable, and the ability to use files outside the project directory.

Rate this Article


Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p