# How to compile dylib plugin on macOS

**URL:** <https://qa.fmod.com/t/how-to-compile-dylib-plugin-on-macos/22726>\
**Category:** FMOD Engine\
**Tags:** mac, plugin-api\
**Created:** [March 23, 2025, 4:24am UTC](https://qa.fmod.com/t/how-to-compile-dylib-plugin-on-macos/22726 "2025-03-23T04:24:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kalman](https://avatars.discourse-cdn.com/v4/letter/k/59ef9b/32.png) [@kalman](https://qa.fmod.com/u/kalman)\
**Post date:** [March 23, 2025, 4:24am UTC](https://qa.fmod.com/t/how-to-compile-dylib-plugin-on-macos/22726/1 "2025-03-23T04:24:17Z")

</div>

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](https://qa.fmod.com/t/plugin-errors-on-mac-10-14/17132) without responses, but I do need to get this working ideally without switching to Windows.

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [March 25, 2025, 6:43am UTC](https://qa.fmod.com/t/how-to-compile-dylib-plugin-on-macos/22726/2 "2025-03-25T06:43:08Z")

</div>

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](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/5/5cfaf19efd3ff0c249751ba9848a42fc06d6aab3.png)  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/c/cc368277a13c6e168ffe6c540f71ac975bd2c7c6.png)  
and replace it with `x86_64`

1. The build target should now say `My Mac (Rossetta)`  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/f/f2184f1b81c96055b718c930522343739a6c6bb1.jpeg)  
You can now build the plugin and place it in the plugins folder.

Please let me know if you encoutner any issues!

---

<div class="post-metadata">

**Author:** ![kalman](https://avatars.discourse-cdn.com/v4/letter/k/59ef9b/32.png) [@kalman](https://qa.fmod.com/u/kalman)\
**Post date:** [March 27, 2025, 1:52am UTC](https://qa.fmod.com/t/how-to-compile-dylib-plugin-on-macos/22726/3 "2025-03-27T01:52:18Z")

</div>

Thanks Connor, works great, though my xcode is a little different to yours (16.2?) what worked for me is enabling “Any Mac” under “build” in the “Product \> Destination” main menu.

 ![Screenshot 2025-03-27 at 12.51.49 PM](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/4/4b927789ccd79123d63433fa76eef81590978b75.png)  
 ![Screenshot 2025-03-27 at 12.48.34 PM](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/e/ef8af68865bfe57e683c2ca9319308eb15511798.png)

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [March 27, 2025, 3:22am UTC](https://qa.fmod.com/t/how-to-compile-dylib-plugin-on-macos/22726/4 "2025-03-27T03:22:54Z")

</div>

Good to hear it worked! Thank you for sharing your solution!
