- Home /
Linux build is putting libNative.so in wrong place
I am new to this Unity world, so I might be doing something wrong...
But, I am getting a DllNotFoundException for my Linux build. The Windows and MacOS build work fine, so it is not my managed code. The Linux library works fine in other .NET apps, so it is not that. And finally, when I look at the error message and move my native library to the location it is looking in, the game works.
Basically, this is a simple game that creates a 2D texture using SkiaSharp. My p/invoke looks like this (SKColorType is an enumeration):
[DllImport("libSkiaSharp", CallingConvention = CallingConvention.Cdecl)]
public extern static SKColorType sk_colortype_get_default_8888();
I have all of this on GitHub: https://github.com/mattleibow/SkiaSharpUnityDemo The log files: - console log: https://gist.github.com/mattleibow/b6e95312ada816496cd8afbcae36f8b1 - player log: https://gist.github.com/mattleibow/3f76cef131cf71abe8ca47d109806580
SkiaSharp: https://github.com/mono/SkiaSharp
This may be related to my question: http://answers.unity3d.com/questions/1394446/dllnotfoundexception-on-linux-2.html
Answer by mattleibow · Oct 26, 2017 at 09:57 PM
The answer is here: https://forum.unity.com/threads/linux-build-is-putting-libnative-so-in-wrong-place.497250/
What's going on here is that linux expects libraries to be
libSomething.so
- so since you're importinglibSkiaSharp
instead ofSkiaSharp
, it's looking forliblibSkiaSharp.so
Your answer
Follow this Question
Related Questions
DllNotFound when the plugin c++ dll links another c++ dll 2 Answers
Native Plugin library depends on another library: DllNotFoundException 0 Answers
Distribute terrain in zones 3 Answers
How to access USB on Linux 1 Answer
ArgumentException: weird Error 0 Answers