Scott Hanselman

Visual C++ for Linux and Raspberry Pi Development

April 6, '16 Comments [20] Posted in Open Source | VS2015
Sponsored By

It's bananas over at Microsoft. Last week they announced you can run Bash on Ubuntu on Windows 10, and now I'm seeing I missed an announcement of an extension to Visual Studio that enables Visual C++ for Linux Development.

With this extension you can author C++ code for Linux servers, desktops and devices. You can manage your connections to these machines from within VS. VS will automatically copy and remote build your sources and can launch your application with the debugger. Their project system supports targeting specific architectures, including ARM which means Raspberry Pi, folks.

ASIDE: I also noticed there's a C/C++ extension for Visual Studio Code also. I need to add that to my list of stuff to check out, it looks pretty compelling as well.

Once Visual C++ for Linux Development is installed, you go and File New Project like this. Cool to see Linux in that list along with a Raspberry Pi project.

File New | Linux App

You can pick x86, x64, and ARM, and you can see Remote GDB Debugger is an option.

Remote GDB Debugger

Here I'm running Ubuntu in a VM and connecting to it over SSH from Visual Studio. I needed to set up a few things first on the Ubuntu machine

sudo apt-get install openssh-server g++ gdb gdbserver

Once that was setup, connecting to the remote Linux machine was pretty straightforward as VS is using SSH.

Debugging C++ apps remotely talking to a Linux VM

Pretty cool.

NOTE: Today this cool extension has nothing to do with the Bash on Ubuntu on Windows announcement or that subsystem.  The obvious next question is "can I use this without a VM and talk to gdb on the local Linux subsystem?" From what I can tell, no, but I'm still trying to get SSH and GDB working locally. It's theoretically possible but I'm not sure if it's also insane. Both teams are talking, but again, this feature isn't related to the other.

This extension feels a little beta to me but it does a good job providing the framework for talking to Linux from VS. The team looks to be very serious and even has a cool demo where they code and debug a Linux desktop app.

If you're looking for a another full featured solution for Linux and Embedded Systems development with Visual Studio, be sure to download and check out VisualGDB, it's amazing.


Sponsor: Quality instrumentation is critical for modern applications. Seq helps .NET teams make sense of complex, asynchronous, and distributed apps on-premises or in the cloud. Learn more about structured logging and try Seq free for 30 days at https://getseq.net.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb
Wednesday, 06 April 2016 08:53:34 UTC
So it uses the remote g++ compiler to do the build. I like the idea of using visual studio to compile all the things!
Wednesday, 06 April 2016 09:39:11 UTC
Tantalizingly close to VS being a great Linux dev environment. Yeah, the home run is to use VS to build and debug ELF binaries using Bash on W10. Even now, can't we do a Post Build event to shell out to bash to do a g++ compile? That alone would be a major convenience. Looking down the road, another major convenience would a VC++ that produces an ELF binary (love Rosyln) so one source code, one IDE, one compiler works for Windows/Linux/Android.
Robert Salita
Wednesday, 06 April 2016 14:43:30 UTC
Why does the extension require me to install Java and an Android SDK if the remote system being targeted has none of that?
CrashOverride
Wednesday, 06 April 2016 17:17:22 UTC
@CrashOverride Maybe @AcidBurn could help you find the answer
anoncpp
Wednesday, 06 April 2016 18:33:54 UTC
Nice post, thanks. I'm the PM working on this. Yes we're working with the bash folks here but nothing to say about that just yet.

@CrashOverride, it's because we use a component that is part of the Android Tools called the MIEngine that provides the bridge from the VS debugger to GDB. We are actively working on packaging that dependency as part of our install to remove the dependency. This was the quickest way to get it to people for feedback.



Thursday, 07 April 2016 10:02:50 UTC
@Marc Goodner, God's speed.
Robert Salita
Thursday, 07 April 2016 11:34:36 UTC
Embrace.
Extend.
Extinguish.

I suspect, though, this time around is going to be a bit harder. Just ask the folks at Sun and Oracle about their attempts to hijack an open source project.
Friday, 08 April 2016 07:21:24 UTC
@Howard - or all of MS efforts in the last year or 2 could just show off how closed off and bad Google and Apple are now in comparison. Where is Siri, Google Now, Safari, YouTube apps etc.. for Windows (desktop and mobile)?

Where is .NET framework, Office, SQL Server, Cortana oh that's right Windows, Mac, Linux either now or within the next year.

Want to compile a iOS app, gotta have a mac - errr why? it's intel just like my PC, oh wait cause Apple.

Peter
Friday, 08 April 2016 11:44:09 UTC
Great post.

How to reference external libraries?

Thanks
Tuesday, 12 April 2016 11:40:23 UTC
Great Post... nice
Tuesday, 12 April 2016 11:40:23 UTC
Great Post... nice
Friday, 15 April 2016 05:51:28 UTC
very helpful post man, thanks for sharing.
Sunday, 17 April 2016 17:30:18 UTC
Nice Content
Thanks For Sharing........
Sunday, 15 May 2016 16:00:29 UTC
Amazing articles. Such a useful for me.
Sunday, 15 May 2016 16:03:45 UTC
Great post. Thank you.
Friday, 27 May 2016 19:33:53 UTC
Great info and i really like your work! thanks a lot or sharing! Free Android APK file download safe link apkdom.com best safe APK downloader free download mirror xapk obb server CoC private link. Love fun ideas lovematchfun join now. The Best Prank Apps, jokes and shocking Games for Android. prankyapps electric screen joke, Love Match test Prank, transparent screen android app, etc. Free Android app APK download softlot app games APK downloader. Gift Ideas giftspilot gifts for her and kids. Cheers!
debioa
Monday, 30 May 2016 23:16:05 UTC
very helpful post man, thanks for sharing.
Tuesday, 21 June 2016 18:29:29 UTC
Nice article ! I got useful info ! Thanks again keep on sharing
Also Read
Snaptube APK App Free Download
Wednesday, 22 June 2016 10:55:46 UTC
nice article really informative about Visual C++.
Wednesday, 22 June 2016 11:06:39 UTC
great post and very informative things about C++ visual
Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.