Mono shared library under linux location

冷暖自知 提交于 2019-12-20 02:31:31

问题


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


回答1:


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

LD_LIBRARY_PATH=. mono yourapp.exe



来源:https://stackoverflow.com/questions/10963498/mono-shared-library-under-linux-location

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!