Are Projects Portable Amongst Platforms?

Hi all,

I’m just getting started with openFrameworks and would appreciate any advice on the best ways to develop/package projects. I’m currently developing on Windows 10 using Visual Studio 2017. I’ve installed openFrameworks, played with many of the examples, worked through some of the oF book and created a couple of my own toy projects. All that has been wonderful. :grinning:

My ultimate target platform is a single board computer running Linux. The specific board is yet to be determined, but current contenders include ARM-based processors. My question is… If I develop my project on Windows, what will I be faced with when I ultimately want to move that project to my target platform?

I understand there will be performance considerations based the differing capabilities of my development machine vs. the the target machine. But what other “porting” issues am I likely to face? And what would the porting process look like?

Would it be a matter of installing openFrameworks on the target machine, setting up a new project there, and moving my source into that project? Or…?

Is it better to develop on the target platform to avoid the porting process altogether? But what if one needs to deploy to multiple platforms?

All insights welcomed!

Thanks,
James

Hi James,

I think there’s no problem making an app that would be cross-compatible; in most cases, you can just generate a project let’s say in Visual Studio on Windows - creating the source files main.cpp, ofApp.cpp and ofApp.h - and if you have multiple computers with different OSes, copy the project folder with src into another computer(if you’re using some data files, you need to copy your data folder in your bin folder). You can then, let’s say, install QtMaker with OF on Linux or XCode on OS X, generate the project, substitute the src files with those copied (and data files in bin folder respectively…) from the windows computer…

This should be compatible across all platforms; though there are some pitfalls you need to avoid, like using unofficial addons. The ones provided by the project generator can be included when you’re generating your project and you need to include every ofx addon you’re using.

1 Like

Thanks mr.Bitmap! That’s pretty similar to what I thought the process might be. Good tip about being careful with the unofficial addons. I guess those may not have been tested or may not be available on all the supported platforms?

It does seem that keeping the source code in sync between the platforms could be somewhat awkward. Hmm… maybe I should look at how one could use git within openFrameworks projects. I have to believe others have been down that road. :thinking:

Generally the code is pretty much portable.
However, OF will leverage different libs for different systems.
For example to play sounds, it will rely on FMOD on Windows, and OpenAL on Linux.
Also, makefile are not the same for Windows and Linux. Using the template ones should be enough for a simple project.
So expect some porting…

1 Like

That’s a very useful thing to know. Thanks!