linux下单的位置共享库 [英] Mono shared library under linux location

查看:134
本文介绍了linux下单的位置共享库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有C ++编写的,我想在Linux下使用Mono使用共享库,
我按照本指南的 http://www.mono-project.com/Interop_with_Native_Libraries

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

我得到它的工作,但我必须把我的库文件到/ usr / lib或/ lib文件夹。

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

反正是有,我可以分发和使用我的.so文件,而不是将它们复制到/ usr / lib或/ lib目录,而是在我的单应用程序文件夹? (当前目录所在的应用程序运行)

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)

某些用户使用该软件可能没有根/管理员权限,因此他们无法安装/文件复制到/ usr / lib或/ lib目录

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

推荐答案

我认为你必须启动你的程序时使用环境变量LD_LIBRARY_PATH:

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

LD_LIBRARY_PATH =。单yourapp.exe

LD_LIBRARY_PATH=. mono yourapp.exe

这篇关于linux下单的位置共享库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆