C#C
C#4y ago
damia

DllImport Troubles

Hello there. I'm running on linux. I'm trying to load symbols from a library named libxyz.so. I have written it as such:
[DllImport("xyz", EntryPoint = "blahblahblah")]
however, I get this runtime error:
Unhandled Exception. System.DllNotFoundException: Unable to load shared library './xyz' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: ./xyz: cannot open shared object file: No such file or directory
I used the LD_DEBUG environment variable as instructed, and discovered that while the runtime is correctly identifying the possible permutations (xyz, libxyz, xyz.so, libxyz.so) it is only searching for those permutations in the system search path (i.e. /usr/lib) and nowhere else. That is to say, it is not searching the current directory, which is where the file is located. How can I remedy this?
Was this page helpful?