Creating a C++ Beaglebone app with Visual Studio

This tutorial shows how to create a simple C++ project for the Beaglebone Black board using Visual Studio and VisualGDB 4.1 or later.

  1. Althrough the Beaglebone Black board contains a pre-loaded Linux image in its internal memory, it's recommended to use an external micro-SD card and program it with the latest image from the Beaglebone site (e.g. using WinFLASHTool):
  2. Connect your Beaglebone Black board to a power source (e.g. via USB) and network. The LEDs will start blinking indicating the system activity:
  3. Open Visual Studio and begin creating new project with VisualGDB->Linux Project Wizard:
  4. As we are creating the simplest possible application, leave defaults on the first page and click "Next":
  5. On the next page select "Create a new SSH connection" and enter the hostname of your Beaglebone board. By default you can connect by specifying "root" as your user name and providing an empty password:
  6. In this example we will setup our project so that it will be compiled directly on the Beaglebone board. It is slower than using cross-compiler, but simpler to achieve:
  7. When you press "Next" VisualGDB will ensure that your Beaglebone board contains all the necessary tools to build your project:
  8. At this point we don't want to change the source disposition settings, so simply press "Finish" on the last page:
  9. VisualGDB will generate a Visual Studio project for you. Build it and see how the source files are transferred to the Beaglebone board and built there using GCC:
  10. Set a breakpoint in main() and press F5 to begin debugging. Once your breakpoint is hit, step over so that the "Hello, World" line is displayed in the output window and hover the mouse over sz to see its value:
  11. If building projects on Beaglebone is too slow for you, follow this tutorial to setup cross-compilation.