I read both Eclipse and VS supports remote development/debugging but I haven't tried with Eclipse yet. I recently tried with Visual Studio and it works pretty well. There are many blogs and articles already how-to's -- so this posting is note to myself.
- Visual Studio 2017
If you have Visual Studio 2017, it supports this out of the box, but I only have Visual Studio 2015.
- Visual Studio 2015
Download this extension from below link, install it , and follow the steps: https://marketplace.visualstudio.com/items?itemName=VisualCppDevLabs.VisualCforLinuxDevelopment
Linux SideIt is assumed SSHd is installed and configured.
$ sudo apt-get install -y openssh-server g++ gdb gdbserver
For "Blink" sample project in VS, do this on RPi:
$ sudo apt-get install git-core
$ git clone git://git.drogon.net/wiringPi
$ cd wiringPi
$ sudo ./build
- Run VS
- File > New > Project > Installed > Visual C++ > Cross Platform > Linux
- Select "Console Application (Linux)"
- It'll ask for SSH connection to Linux
- Back to the sample code, make sure the target platform is "ARM"
- Click on "Remote GDB Debugger"
│ └── ARM
│ └── Debug
│ └── ConsoleApplication1.out
"ConsoleApplication1.out" is the binary.
Please read the links in References to find more info.
VS Connection ManagerTo add, edit connections:
Tools > Options > Cross Platform > Connection Manager
For existing project, go to Project Properties to change existing connections and other settings.
Remote Debug & Bring up TerminalClick on "Remote GDB Debugger", and from top menu, Debug > Linux Console.
Set Command Line Parameters
- Right click on Project (not Solution), and bring up Properties
- Configuration Properties > Debugging
- And on right pane, find "Program Arguments"
- Visual C++ for Linux Development with CMake
- Using Visual Studio for Cross Platform C++ Development Targeting Windows and Linux
- Blinky Project