- Home /
DllNotFoundException on Linux
Hi,
I am running Unity 5 on Ubuntu 14.04 32bits via wine and playonlinux. I am trying to make a C# script that uses OpenNI library. I have the OpenNI.dll file and I used it in a project without unity and it works fine, but when I use it in the unity script and run the game a DllNotFoundException is thrown.
I tried to copy the file to project folder, Assets folder, Editor folder but nothing works. Do you know why is this happening and how can I solve it?
Thank you!
Looking for the cause of the error I found the following problem: The Unity error stack says:
DllNotFoundException: OpenNI OpenNI.EnumerationErrors.Create () OpenNI.EnumerationErrors..ctor () OpenNI.Context.InitFromXmlEx (System.String xmlFile, System.IntPtr& hScriptNode) OpenNI.Context.CreateFromXmlFile (System.String xmlFile, OpenNI.ScriptNode& scriptNode) DrawTexture.Start () (at Assets/Scripts/DrawTexture.cs:24)
I looked into OpenNI.EnumerationErrors.Create() method and I found that line:
int status = SafeNative$$anonymous$$ethods.xnEnumerationErrorsAllocate(out pErrors);
So I think the problem is that Unity does not find the class SafeNative$$anonymous$$ethods. Using OpenNI lib outside Unity works fine, but using it with unity throws this error.
Your answer
Follow this Question
Related Questions
DllNotFoundException libmonoposix 2 Answers
Linux Unity: Recognize dependent dll files 0 Answers
Linux build is putting libNative.so in wrong place 1 Answer
How can I run it on Linux? 4 Answers
Would it be possible to build Unity projects from Linux? 1 Answer