神刀安全网

Writing C++ for Linux on Visual Studio

Microsoft debuted their Visual Studio 2015 Extension which provides for writing C++ code in VS2015 that 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 “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.)

On this author’s 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 that 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 of describing all of 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.

转载本站任何文章请注明:转载至神刀安全网,谢谢神刀安全网 » Writing C++ for Linux on Visual Studio

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址