Compilation without XCode on OS X

Hi there !

I am trying to compile the video grabbing part of OF without XCode but the compiler complains about “MediaHandler” not being defined. From Apple docs, “MediaHandler” should be defined by the QuickTime headers but somehow it’s not working…

[  2%] Building ../Camera.cpp.o  
In file included from ../video/ofVideoGrabber.h:10,  
                 from ../Camera.cpp:31:  
../video/ofQtUtils.h:45: error: ‘MediaHandler’ was not declared in this scope  

I tried to link against the static lib, but I get the same problem when I include the VideoGrabber headers. The XCode opencvExample runs fine.

Any help would be greatly welcome (exhibition in 1 week…).


[3:41 am edit]

I finally found the problem: QuickTime does not support 64bit compilations and the header inclusion was just ignored without a warning ( :expressionless: ).

Here is the solution:

set(CMAKE_OSX_ARCHITECTURES "i386" CACHE STRING "Build architectures for OSX" FORCE)  

(since I am not using all of OF code, I also had to mock several utility and globals)

Hi Gaspard
I’m having sort of the same problem but with Xcode
(the compiler complains about the ‘MediaHandler’ not being declared, along with a bunch of other things)

read here for pictures of my problem[solved]-xcode-compilation-problems-roundup-and-solutions/5052/0

do you know how to solve that in Xcode? (I couldn’t find the “FORCE” option)
do I have to change the architecture to just i386 instead of all the options (i386, ppc etc)?

do you have any tips or instructions on how to get rid of Xcode to compile Of?
what’s your setup?

thanks in advance

here are a couple of imgs of the settings relating your solution

and options available