Running the FMOD Moai Host on Mac OS

I ran into a small problem today, that took more then a few cycles to puzzle out.

 

Basically I was installing and configuring Moai to work on Mac, and this process had a few steps.

First I had to install the FMOD libraries and configure them in Xcode. 

Then I needed to build each host ( I am working from Git instead of the compiled binaries )

I then configured my preferred Lua/Moai IDE IntelliJ according to my own guide, which by the way, worked exactly the same.

 

But then, when it came time to run my code via moai-fmod-ex I got an error along the lines of error ./libfmodex.dylib does not exist which makes sense in the end.  The Moai Mac host is built to expect the FMOD dylib to be in the same directory as executable.  Problem is, when you run it as a tool within IntelliJ and give it a different working directory, it will not find the DLL.  I tried setting the path using DYLD_LIBRARY_PATH, but oddly this didn’t work.  I did manage to get the Moai host running by using the bizarrely named install_name_tool, which also presented a new challenge.

 

Apparently… Xcode used to install this tool in the /usr/bin directory, but then they changed it to the /Developer/usr/bin directory… then apparently they changed it again to the /Applications/Xcode.app/Contents/Developer/usr/bin/ folder, which is not in the PATH and is a pain in the ass to type, so I copied it to /usr/bin ( sudo required).

 

I then relocated the path to the dylib by:

change to moai fmod host directory

install_name_tool -change ‘./libfmodex.dylb’ ‘/path/to/dylib/file/libfmodex.dylb’ moai-fmod-ex

 

 

Now it runs properly from within IntelliJ. 

General Mac Moai


Scroll to Top