Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 620
technomage Avatar asked Apr 10 '26 02:04

technomage


1 Answers

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

LD_LIBRARY_PATH=. mono yourapp.exe

like image 129
knocte Avatar answered Apr 11 '26 14:04

knocte



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!