How can I setup an OF project in XCode from scratch?

Hello,

I’ve managed to create a few decent experiments with OF, but I am missing some understanding on the setup of a project that I feel is really holding me back.

For instance, when I tried to use Theo’s face tracking project (mentioned in the examples forum), I can’t get it to compile. First it seems that all of the files are targeted wrong, so I relink them, but I still get 1004 errors. Previously I had tried to bring the Poco library into a project and failed similarly.

I am used to setting up OOP projects and bringing in 3rd party libraries in Java/Processing and ActionScript (I usually do all in Eclipse). I feel there is a gap in my understanding of setting up a C++ project, bringing in appropriate libraries and setting up an OF project from scratch. Can anyone give me some pointers or a link to a good tutorial?

thanks,
-Kyle

In the past, I’ve pre-compiled whatever library I’m using using its preferred tool (make, XCode, rake, Code Blocks, whatever), then drag the shared library files and header files into my project. That is usually enough to get me started. It’s a messy solution, but it seems to be a reasonable fallback.

I would also like to see a good tutorial on linking or including other projects into one’s project in XCode.

The cause of the problem is most likely that the project you are downloading is for an older version of openframeworks (e.g. 005 or 00573). The simplest way to get a project from an older OF version working, is to start with a blank OF006 project. Basically duplicate the OF006 empty example, then overwrite the testApp.cpp, testApp.h and main.cpp with the ones from Theo’s project. Then if there are any additional source files add them to your new project as well.

openframeworks has a lot of dependencies (freeimage, freefont, poco, fmod etc.) and setting them all up involves a fair amount of adding libs, header directories to search paths etc. If you are feeling adventurous I suggest looking through and examining an existing OF006 project to see what paths and libs are added where, but otherwise the method above (duplicating an empty example) works fine.

P.S. additionally I’ve made an xcode-template, and roxlu has a http://forum.openframeworks.cc/t/openframworks-wizard-for-codeblocks/1979/8 which allows you to create an empty openframeworks project straight from the IDE.

memo—I didn’t know about the XCode template nor the Code::Blocks wizard. Siiick! Maybe this will inspire me to explore porting some of my projects from OS X to Linux or Windows…

Thanks for everything Memo :slight_smile: