C# – Mono shared libraries under the linux location

Mono shared libraries under the linux location… here is a solution to the problem.

Mono shared libraries under the linux location

I

have a shared library written in C++ that I want to use with Mono under Linux,
I followed the guide http://www.mono-project.com/Interop_with_Native_Libraries

I

got it working, but I have to put my library files into the /usr/lib or /lib folder.

Can I distribute and use my .so files, instead of copying them into /usr/lib or /lib, but into my Mono application folder? (the current directory where the app runs).

Some users of the software may not have root/admin access, so they cannot install/copy files to /usr/lib or /lib

Solution

I think you have to use the environment variable LD_LIBRARY_PATH:: when starting the program

LD_LIBRARY_PATH=。 Mono Yourapp .exe

Related Problems and Solutions