- Home /
Why does my 32-bit dll plugin(c++) work in Unity 4 and not in Unity 5 indy (Windows 32-bit editor)
My dll (c++), compiled with VS2010, runs in Unity 4 (pro), but fails to load in the Unity 5 (32-bit windows) editor. When the scene containing the plugin is loaded I get:
Failed to load 'Assets/Plugins/spatOSC/win32/spatOscPlugin.dll' with error 'The operation completed successfully.
', GetDllDirectory returned ''. If GetDllDirectory returned non empty path, check that you're using SetDirectoryDll correctly.
then followed, of course, by
DllNotFoundException: Assets/Plugins/spatOSC/win32/spatOscPlugin.dll
spatOSCsetup.Awake () (at Assets/scripts/spatOSC/spatOSCsetup.cs:306)
I have looked at other posts reporting this kind of problem. Solutions pertaining to my problem were proposed here: http://answers.unity3d.com/questions/993154/failed-to-load-dll-error.html
which linked to here:
http://stackoverflow.com/questions/15923595/how-to-use-a-c-dll-in-unity3d (which appeared to be a bit beyond my problem)
So I tried the solutions proposed, such as locating the plugins in the plugins folder in the Assets folder, setting the plugin's platform-specific properties, or installing Microsoft Redistributable packages, etc. But nothing works so far.
I even tried recompiling the plugin for X64, and running it on Unity 5 (64-bit) editor, but had the same result.
I am stuck: so I am curious to know what differences between Unity 4 and Unity 5 would cause the plugin to work in one, and not the other. Maybe that will shed some light on something else to try.
(for what it's worth, the plugin is a wrapper for a C++ library, using VS2010 C99 support)
thanks
Something changed with regard to the way plugins are used in the editor.
I'm trying to locate the page but I think it was removed.
It used to be in the Unity 5 Upgrade info of the architecture section of the manual.
yes, I saw the Upgrade page on plugins.
[1]: http://docs.unity3d.com/$$anonymous$$anual/UpgradeGuide5-Plugins.html][1]
Plugin location is less critical in Unity 5, and there is now a property browser, that allows you to associate plugin builds with specific architectures. I followed the instructions but the problem remains.
Your answer
Follow this Question
Related Questions
UnauthorizedAccessException when accessing DLL 1 Answer
DllNotFoundException in standalone 2 Answers
FileNotFoundException: Could not load file or assembly 0 Answers
return char** from C++ DLL 0 Answers
Unity5 Set Placeholder and CPU 0 Answers