I have a VST3 plug-in that uses a precompiled dynamic C library (libphonon). On Windows, I put the .dll in C:\Windows\system32, and it works as expected in all hosts/DAWs that I’ve tried. Unfortunately, I don’t have access to the source of the dynamic library.
On macOS, I place the dylib in /usr/local/lib, and it works fine on all hosts that I’ve tried except for Ableton Live 11. The machine I’m testing on has an M1 processor/Apple silicon. I’m compiling against JUCE 7.0.4. When I don’t link with the dylib, the plug-in does show up in Ableton, so it’s definitely something about linking with it.
Using otool -L
on the dylib, I can see the first entry is:
@rpath/libphonon.dylib
I added debug entitlements to Ableton, and was able to get a bit more insight when I launched it from Xcode. Ableton’s debug output will sometimes say that @rpath/libphonon.dylib
failed to load/not found, which explains why the plug-in fails Ableton’s scanning.
I’ve also tried using install_name_tool -change
to change @rpath/libphonon.dylib
to the absolute path /usr/local/lib/libphonon.dylib
on the VST3 (MyPlugin.vst3/Contents/MacOS/MyPlugin) without any luck.
Alternatively, I’ve also tried setting the VST3 to @loader_path/../Frameworks/libphonon.dylib
using install_name_tool
, and then adding libphonon.dylib to MyPlugin.vst3/Contents/Frameworks/libphonon.dylib
, in an attempt to bundle it with the plug-in (and removing /usr/local/lib/libphonon.dylib). When I do this, if I launch the DAW from Xcode via the debugger (AudioPluginHost, Reaper, Tracktion Waveform, etc., not Ableton though), the library resolves, but if I just open the app without a debugger attached they all crash for some reason.
So essentially, copying the dylib to /usr/local/lib
is working great, except Ableton, and my attempts to use install_name_tool
to adjust the VST3’s library is showing mixed results and still no love in Ableton.
#1, does anyone know what or why Ableton is doing something different with dynamic library paths on macOS vs. other DAWs?
#2, does anyone know the best way to include dynamic libraries with plug-ins on macOS that works across the board, including in Ableton Live?
Curious if anyone else has run into this behavior.
Update:
This is what the Ableton debug output says:
2023-10-05 14:27:22.954629-0700 Ableton Plugin Scanner[789:11485] Error loading /Users/michael/Library/Audio/Plug-Ins/VST3/MyPlugin.vst3/Contents/MacOS/MyPlugin: dlopen(/Users/michael/Library/Audio/Plug-Ins/VST3/MyPlugin.vst3/Contents/MacOS/MyPlugin, 262): Library not loaded: @rpath/libphonon.dylib
Referenced from: /Users/michael/Library/Audio/Plug-Ins/VST3/MyPlugin.vst3/Contents/MacOS/MyPlugin
Reason: image not found
error: Failed to load plugin: The bundle “My Plugin” couldn’t be loaded because it is damaged or missing necessary resources.