How to compile for Mac OSX 64bits with gcc instead of Xcode?

Has anybody had luck compiling Open Frameworks for Mac OSX 64bits using gcc instead of Xcode? If so, please give details!

I’m trying something like this:
c++ my-test-camera.cc -I of_preRelease_v0062_osxSL_FAT/libs/openFrameworks/ -I of_preRelease_v0062_osxSL_FAT/libs/openFrameworks/app/ -I of_preRelease_v0062_osxSL_FAT/libs/openFrameworks/utils/ -I of_preRelease_v0062_osxSL_FAT/libs/openFrameworks/communication/ -I of_preRelease_v0062_osxSL_FAT/libs/openFrameworks/sound/ -I of_preRelease_v0062_osxSL_FAT/libs/openFrameworks/video/ -I of_preRelease_v0062_osxSL_FAT/libs/openFrameworks/events/ -I of_preRelease_v0062_osxSL_FAT/libs/openFrameworks/graphics/ -I of_preRelease_v0062_osxSL_FAT/libs/glee/include/ -I of_preRelease_v0062_osxSL_FAT/libs/glut/include/ -I of_preRelease_v0062_osxSL_FAT/libs/poco/include/ -I of_preRelease_v0062_osxSL_FAT/libs/fmodex/include/ -I of_preRelease_v0062_osxSL_FAT/libs/FreeImage/include/ -I of_preRelease_v0062_osxSL_FAT/libs/rtAudio/include/ -I of_preRelease_v0062_osxSL_FAT/libs/freetype/include/

But get various errors such as:

of_preRelease_v0062_osxSL_FAT/libs/openFrameworks/video/ofQtUtils.h:45: error: ‘MediaHandler’ was not declared in this scope
of_preRelease_v0062_osxSL_FAT/libs/openFrameworks/video/ofVideoGrabber.h:86: error: ‘SeqGrabComponent’ does not name a type

These errors go away if I compile for 32bits instead (which I found on another post, thanks) however my app is 64bit.

Also, how would I get gcc to properly link with open frameworks ?

Thanks!

I’ll reply to my own post, since I eventually figured it out…

First, the current version of OF just does not support 64bit compilation. This will likely be fixed eventually via porting the video grabber to QTKit. Here is someone who has already wrapped this in OF: http://forum.openframeworks.cc/t/ofxqtkitvideograbber-qtkit-amp;-corevideo-±of/3555/11 in case that helps.

Second, in Xcode if you go to Build -> Build Results there is a little white square icon with horizontal lines on it. If you click on that it shows you the (rather long) call to gcc that it used. With some pathname fussing you can copy that info over and use gcc directly via makefile, cmake, or whatever.

I trimmed things down a little because I was only using the video grabber calls, and got something like this to work:

c++ test-camera.cc -m32 -I of_preRelease_v0062_osxSL_FAT/libs/openFrameworks/ -I of_preRelease_v0062_osxSL_FAT/libs/openFrameworks/app/ -I of_preRelease_v0062_osxSL_FAT/libs/openFrameworks/utils/ -I of_preRelease_v0062_osxSL_FAT/libs/openFrameworks/communication/ -I of_preRelease_v0062_osxSL_FAT/libs/openFrameworks/sound/ -I of_preRelease_v0062_osxSL_FAT/libs/openFrameworks/video/ -I of_preRelease_v0062_osxSL_FAT/libs/openFrameworks/events/ -I of_preRelease_v0062_osxSL_FAT/libs/openFrameworks/graphics/ -I of_preRelease_v0062_osxSL_FAT/libs/glee/include/ -I of_preRelease_v0062_osxSL_FAT/libs/glut/include/ -I of_preRelease_v0062_osxSL_FAT/libs/poco/include/ -I of_preRelease_v0062_osxSL_FAT/libs/fmodex/include/ -I of_preRelease_v0062_osxSL_FAT/libs/FreeImage/include/ -I of_preRelease_v0062_osxSL_FAT/libs/rtAudio/include/ -I of_preRelease_v0062_osxSL_FAT/libs/freetype/include/ -Lof_preRelease_v0062_osxSL_FAT/libs/freeimage/lib/osx -Lof_preRelease_v0062_osxSL_FAT/libs/FreeImage/lib/osx -Lof_preRelease_v0062_osxSL_FAT/libs/GLee/lib/osx -Lof_preRelease_v0062_osxSL_FAT/libs/poco/lib/osx -Lof_preRelease_v0062_osxSL_FAT/libs/rtAudio/lib/osx -Lof_preRelease_v0062_osxSL_FAT/libs/fmodex/lib/osx -Lof_preRelease_v0062_osxSL_FAT/libs/freetype/lib/osx -Lof_preRelease_v0062_osxSL_FAT/libs/FreeImage/lib/osx -Fof_preRelease_v0062_osxSL_FAT/libs/glut/lib/osx -dead_strip of_preRelease_v0062_osxSL_FAT/libs/openFrameworksCompiled/lib/osx/openFrameworksDebug.a of_preRelease_v0062_osxSL_FAT/libs/GLee/lib/osx/GLee.a of_preRelease_v0062_osxSL_FAT/libs/rtAudio/lib/osx/rtAudio.a -framework ApplicationServices -framework OpenGL -framework QuickTime

1 Like