Cross compiling for Raspberry Pi from Windows

Hi all!
On the recommendation of @arturo , I’ve been investigating VisualGDB which is capable of:

  1. Cross compiling
  2. Deploying
  3. Remote debugging

It seems to significantly simplify the process of cross-compilation, e.g.:

  1. it will download a toolchain for your Raspbian version
  2. it will sync relevant folders

From there, it works within Visual Studio and is somewhat compatible with the usual MSBuild workflow features (e.g. .props).
I’ve posted a mini log of my progress here:
Topic: Log : cross-compiling openFrameworks to Raspberry Pi using VisualGDB | Sysprogs

And now that it’s mostly working (emptyExample runs fine). I’m trying to get my actual project building (i.e. with more addons).

Caveats:

  • You have to pay ~100USD/year to use it (30 day free trial with all features)
  • It isn’t great at importing Makefile projects, so I’ve actually remade a build system from scratch using MSBuild.
  • Precompiled headers need to be in the same folder as the project file (it seems?? unsure - basically pch is quite tricky at the moment)
  • System slows down considerably during builds (it seems to be ‘less polite’ than when VC++ is building)
  • I’ve disabled sound for now. It should be pretty easy to bring back (watch out for the TARGET_NO_SOUND in the props file)

IF you want to try it out then try the emptyExample here:
elliotwoods/ofxVisualGDBCrossCompile: Use VisualGDB to cross-compile, deploy and debug on Raspberry Pi (github.com)

2 Likes

@arturo - thanks for the tip!
I’ll keep updated here if I can get a more complicated app to build and run through this

OK this is working with some moderately complicated addons


A few notes as of now:

  1. The libs are lazily added to the project by me (i.e. if you use more oF features, you’ll need to add the right libs yourself to the settings, or even better add it to openFrameworks_GDB.props and push it back to the source repo)
  2. When copying emptyExample, you’ll need to rename the .vgdbsettings files to match your project, and also change the contents of the files to point to the correct .vcxproj
3 Likes