简体   繁体   中英

Mono shared library under linux location

I have a shared library written in C++ that I'd like to use with Mono under Linux, I follow this guide http://www.mono-project.com/Interop_with_Native_Libraries

I got it to work, but I have to put my library file into /usr/lib or /lib folder.

Is there anyway that I could distribute and use my .so files and not copy them into /usr/lib or /lib but instead into my Mono application folder ? (current directory where the app running)

some user using the software might not have root / admin access, therefore they can't install/copy the files into /usr/lib or /lib

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

LD_LIBRARY_PATH=. mono yourapp.exe

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM