libpd4unity icon indicating copy to clipboard operation
libpd4unity copied to clipboard

iOS: Unable to load DLL 'libpdcsharp'

Open kevvy-log-ins opened this issue 8 years ago • 4 comments

I'm working with Unity 5.5.1f1 on macOS 10.12.3. I can compile 01_LibPd_Basic as a Mac Standalone, and it works as expected (after I make changes suggested in previous bug reports).

When switching the platform to iOS, however, while the project compiles, it generates no sound, and Xcode issues the following errors to its console:

  • DllNotFoundException: Unable to load DLL 'libpdcsharp': The specified module could not be found.
  • at LibPDBinding.LibPD.send_float (System.String recv, Single x) [0x00000] in :0
  • at GUIToggleScript.OnGUI () [0x00000] in :0
  • (Filename: currently not available on il2cpp Line: -1)

Coincidentally, no version of the libpdcsharp file exists within the Xcode project, as far as I can tell.

kevvy-log-ins avatar Feb 24 '17 03:02 kevvy-log-ins

hi all was there ever a fix or workaround to this issue?

ablanton avatar Jul 18 '17 16:07 ablanton

I once managed to get a proof of concept working on iOS, but involves getting stuck into xcode to build it as a native plugin. Not for the faint of heart, and it suffered from performance issues. And that was before unity added IL2CPP so I'm not sure how that would work these days.

If you need a working version, I can recommend https://enzienaudio.com/ It's licensed, but the terms are fairly reasonable. It's a platform that cross compiles pd into native unity plugins. Would be less effort to port your code across to heavy than to try add iOS plugin support.

thefuntastic avatar Jul 18 '17 17:07 thefuntastic

@thefuntastic can you comment on the first steps you took to build the iOS dll? Building vanilla libpd for iOS seems straightforward-- what was required to get the C# bindings to work?

Edit -- nvm, I found @n1zzo's comments and am trying it out. Thanks for all the amazing work!

gershhub avatar Aug 13 '17 20:08 gershhub

For anyone happening upon this, I'd suggest replacing the line const string DllName = "libpdcsharp"; in LibPDNativeMethods.cs with the following preprocessor directive:

#if UNITY_IPHONE
const string DllName = "__Internal";
#else
const string DllName = "libpdcsharp";
#endif

gershhub avatar Aug 13 '17 21:08 gershhub