How to compile dylib plugin on macOS

I’m stuck on the first basic step of writing a plugin on macOS - compiling code as a dylib that FMOD will load. There isn’t much documentation on this specifically.

What I’ve tried:

  1. Downloaded the FMOD engine, extracted it
  2. cd into the api/core/examples/plugins directory
  3. gcc -dynamiclib fmod_gain.cpp -I ../../../core/inc -o fmod_gain.dylib
  4. cp fmod_gain.cpp <project’s plugin directory>

When I open up the project the gain isn’t available as a plugin, and I see a message in the console:

15:17:21 Error loading plugin /Users/…/Plugins/fmod_gain.dylib: File not found.

I’ve also tried putting it in ~/Library/Application\ Support/FMOD\ Studio/Plugins instead, but same “file not found” message.

This is an M2 (arm) laptop on Sonoma and I’m using FMOD 2.02.23 for everything. I also tried 2.03 but same issue. I see a couple of other questions about this like Plugin errors on mac 10.14 without responses, but I do need to get this working ideally without switching to Windows.

Hi,

Thank you for the detailed reproduction steps. I have been able to reproduce the issue and will pass it onto our development team to investigate further.

I have a workaround but it does require solving the issue in Xcode.

  1. Open the Xcode examples project: FMOD Programmers API/api/core/examples/xcode32/examples.xcworkspace
  2. Open the fmod_gain example
  • Open the Build Settings and expand All
  • Under Architectures remove the default value

    image
    and replace it with x86_64
  1. The build target should now say My Mac (Rossetta)

    You can now build the plugin and place it in the plugins folder.

Please let me know if you encoutner any issues!