Beginner Project Setup Questions (cross platform project)

I am new to openFrameworks, although I have used Flash for a long time, and more recently processing and PaperJS.

I had a couple of beginner setup questions which I was having some trouble finding info on:

  1. Is it possible to have a single project that compiles in both xcode and visual studio 2012?
  2. Do I have to put my project in the openframeworks directory (I would like to check my code into github)

I tried to setup a project in a custom directory, but there were issues with the paths and I couldn’t get it to compile.

Thanks for any input.


Welcome Mike :smile:

You have to generate two projects with ProjectGenerator tool, which you can find in openframeworks directory : one for xcode on osx, and another one for VS 2012 on windows.
But both projects can share the same code files, and they should normally compile and run without modification on both environment.
Projects are supposed to be in app directory, you can set the directory with project generator.
You can put your code in a github without problem, just create a repository at your project folder path.

1 Like

Just to echo Mat’s comments.

For cross platform projects it really is best to have two full native OS installs of OF on each machine (or separate folders if using a cloud solution).

Keep the myApps directory structure. Although you can change it, it can be problematic. I suggest avoiding change when starting out.

Create the project on each OS using the project generator provided the OF directory for that OS. Then copy all the source from the one folder of an OS to the other same named source folder on the other OS.

Add by hand any required source code to the project on the destination machine.

This should then run fine.

My daily build of porting over to the PC takes me a couple of secs and is as easy as cut & paste of source then a quick add of any new files to the project.

I would also note that going from VS2012 to Mac is ok but going from Mac to VS2012 can be fiddly. I find CodeBlocks a lot easier to port to (it is less fussy about compiling).

Hope that helps!