I have a problem where my code actually works, and I’m not sure why.
I have a C# managed DLL that I drop into my assets folder and call from my Unity C# project. That is all well and good. Within the DLL there is a reference to an external C library (libmkl_rt.dylib, an intel MKL dll installed at /opt/intel/mkl/lib). Now when I run the code that’s in the C# DLL separate from Unity (in VB 2019 or as an exe on the console), if I do not set my DYLD_LIBRARY_PATH to include external C library address, I get a ‘dll not found’ error. However when I run the same code in Unity (hit the play button and a game object runs the code), the code runs fine.
First of all, where does Unity look for DLLs, i.e. what are the library search paths and where do you set them? Does setting the DYLD_LIBRARY_PATH in a shell on the terminal effect anything that Unity does? How is Unity finding this DLL?