BT

New Early adopter or innovator? InfoQ has been working on some new features for you. Learn more

Writing C++ for Linux on Visual Studio

| by Jeff Martin Follow 5 Followers on Jun 16, 2016. Estimated reading time: 1 minute |

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

Adoption Stage
Style

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.

Tell us what you think

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

Email me replies to any of my messages in this thread
Community comments

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

Email me replies to any of my messages in this thread

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

Email me replies to any of my messages in this thread

Discuss

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

BT