During Build 2016, Microsoft released a Visual Studio C++ extension for Linux. With the extension, you can use Visual Studio to write C++ code for Linux devices. In this post, let’s take a glimpse of how to install the extension and how to remotely build and debug C/C++ code for Raspberry Pi.
Getting Started
Install Visual Studio extension for Linux development
Download Visual C++ for Linux.
It will fail to install the extension if you do not have Cross Platform Mobile Development tools installed:
Create a Linux project for Raspberry Pi
Open Visual Studio 2015. Click File > New > Project > Installed > Templates > Visual C++ > Cross Platform > Linux to create a new project for Raspberry Pi:
If you just want to create a simple console project, choose Console Application (Linux).
Open Configuration Manager, and then change platform to ARM.
Click menu Tools > Options > Cross Platform > Linux to create a new connection:
Make sure you have installed following packages on Raspberry Pi:
sudo apt-get install openssh-server g++ gdb gdbserver
Build and debug your code:
What if you see the error message “Could not find a part of the path”?
Update your Visual Studio 2015 to the latest version and restart it:
When using Visual C++ for Linux, I got some weird issues occasionally. Hopefully, Microsoft will fix bugs and release updates as soon as possible.