64bit library (FLAC)

hey there,

I’m trying to build a static library (FLAC) from which my speech to text addon ofxGSTT is dependent. I hope the addon could be helpful for other people and because of that I want it to run on ubuntu, mac and probably win, too. normally I only work on ubuntu and am not very familiar with oF on mac.

I’m working on 64bit OSX (10.6.8) and therefore can only build FLAC as 64bit static lib. the problem is, that oF/xcode can’t link to the lib (libFLAC.a) because “file is not of required architecture”. I get this as a warning and then the linking fails (symbols not found).

My guess is that oF for mac runs as 32bit ignoring the real architecture?!
So must all static libs be build for 32bit or are there any other solutions?

I tried to build FLAC with --build=i386, CFLAG="-arch i386" and CPPFLAG="-arch i386" but then make fails.
Probably I have to keep working at this point but other suggestions would be helpful.

thanks,
felix

Hi, I’ve got across your addon for a project and I got to make it work for mac os x.

I’ve made several changes, added a slightly changed version of ofxJson ( there was an annoying error with assert() ), added ofxCurl ( even though I’m not using the proper ofx library ) and a simple Wav encoder I found somewhere in the forum.

As for the Flac library, I managed to found them for Mac, turns out you need the static and dynamic library + a ogg one.

The only trick was to add the dylib files in the executable path, and then run this script during the build :

  
install_name_tool -id @executable_path/libFLAC.8.2.0.dylib "$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/libFLAC.8.2.0.dylib"  
install_name_tool -change /flac_mac/lib/libFLAC.8.dylib @executable_path/libFLAC.8.2.0.dylib "$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/$PRODUCT_NAME";  
  
install_name_tool -id @executable_path/libogg.0.5.3.dylib "$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/libogg.0.5.3.dylib"  
install_name_tool -change /usr/local/lib/libogg.0.dylib @executable_path/libogg.0.5.3.dylib "$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/$PRODUCT_NAME";  
install_name_tool -change /usr/local/lib/libogg.0.dylib @executable_path/libogg.0.5.3.dylib "$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/libFLAC.8.2.0.dylib";  

That would be great to see if there’s a way to make a universal addon for linux/mac osx.

Here is a project for mac, and your addon and ofxJson modified.

https://dl.dropbox.com/u/817108/of/googleSpeech.zip
https://dl.dropbox.com/u/817108/of/addons.zip

hey - this is great news! very cool - I also had trouble with json (assert) and the current oF version on ubuntu but couldn’t remember how I solved it the last time. I can’t wait to try it out directly. Are you familiar with git and can send the modifications via pull request?

thanks for sharing!

I’ll push it on my repo for sure !

Now, I have some doubts, I don’t know if that makes more sense to separate :

ofxFlacEncoder - needs flac lib
ofxWavEncoder
ofxGoogleUtils ( can be webspeech, image search and image reverse search ) - need curl

What do you think?