Standalone (from 5.3.3f1) fails to find shared library in plugin folder

when run from editor, the shared library is found just fine.

from /home/me/.config/unity3d/corp/Chess/Player.log:

Fallback handler could not load library /home/me/Documents/corp/stand-alone/Chess/Chess_Data/Mono/x86_64/libcorp

stand-alone seems to be looking in the Mono directory instead of the Plugins directory.

$ find . -name *.so
./Chess_Data/Mono/x86_64/libmono.so
./Chess_Data/Plugins/x86_64/ScreenSelector.so
./Chess_Data/Plugins/x86_64/libcorp.so

i tried moving libcorp.so to Chess_Data/Mono/x86_64.
no joy.
i tried copying libcorp.so to Chess_Data/Mono/x86_64.
no joy.
i tried moving libcorp.so to /lib64/
no joy.

debug logging provides the same information formatted differently.

Mono: DllImport attempting to load: ‘libcorp’.
Mono: DllImport loading location: ‘libcorp’.
Mono: DllImport error loading library: ‘/home/me/Documents/corp/stand-alone/Chess/Chess_Data/Mono/x86_64/libcorp: cannot open shared object file: No such file or directory’.
Mono: DllImport loading location: ‘libcorp.so’.
Mono: DllImport error loading library: ‘/home/me/Documents/corp/stand-alone/Chess/Chess_Data/Mono/x86_64/libcorp.so: cannot open shared object file: No such file or directory’.

help!
please and thank you.

to answer my own question…
this works in the editor but not standalone:

[DllImport(“libcorp”)]

this works in standalone but not in the editor:

[DllImport(“corp”)]

so code is now:

#if UNITY_EDITOR
public const string DLL_NAME = @“libcorp”;
#else
public const string DLL_NAME = @“corp”;
#endif

[DllImport(DLL_NAME)]
public static extern void breathe_fire( ref Dino d );

1 Like