Search This Blog

Friday, May 3, 2013

Vamp Host in XCode

I'm working on a Vamp host, and since getting Vamp to play nicely with XCode 4.6.2 (OS X 10.7.5) wasn't as straight forward as I'd have liked, here are the steps I followed.

Work In Progress!

  1. Get the vamp source code and uncompress it
  2. Go to build/Makefile.osx and remove -arch i386 at line 68
  3. Compile the code by typing make -f build/Makefile.osx 
  4. You should now have two libraries: libvamp-sdk.a & libvamp-hostsdk.a 
  5. Create command line XCode project
  6. Add the two libraries to the project
  7. Also add the header files folders: vamp/, vamp-sdk/ and vamp-hostsdk/ 
  8. Go to the target build settings and change the "C++ Standard Library" from "libc++" to "libstdc++"

UPDATE!

The problem compiling the example code for 32 bits (-arch i386) has to do with the libsndfile I have in my machine. It was compiled only for 64 bits (-arch x86_64), and that's why the -arch i386 flag failed. I've been using homebrew to install my dependencies, but althout libsndfile has a --universal option, libogg and libvorbis don't, and failed to copile for i386. My solution was to compile and install libogg and libvorbis manually for both architectures (see this VERY HELPFUL link) and then I finally installed libsndfile using homebrew (you'll need to use the --ignore-dependencies option to prevent homebre to try to install libogg and libvorbis (note that there might be other dependencies that you might need to install).

3 comments:

  1. Hey Jorge,

    Great post -- I'm getting a weird error: dyld:

    Library not loaded: libvamp-hostsdk.dylib
    Reason: image not found

    Any idea why this might be happening?

    Best,
    S

    ReplyDelete
    Replies
    1. Hi Sarith, with such little info is hard to nail down your problem. All I can tell from your message is that you are trying to link against a dynamic library (.dylib), but the compiler can't find it. In that case, you should either copy the dylib file into /usr/local/lib/ or add the path where the dylib file is to the Library Search Path in your project's settings.

      That said, note that in my case I compilied against a static library (.a). In that case, you can simply add the .a file to the project (e.g. drag it onto the file tree on the left pane in XCode.

      Hope that helps!

      Delete