[MonoDevelop] Newbie question: Making a reference to a linux shared library

Petit Eric surfzoid at gmail.com
Mon Oct 6 07:41:07 EDT 2008


2008/10/6 alanb <alan.battersby at ntlworld.com>:
>
> I tried P/Invoke, I created a shared library, wrapped it in C# class and it
> all compiles ok. But when I try to execute one of the external functions I
> get an exception -  System.DllNotFoundException: libtest.so . As this is an
> experiment I do not want to place my library in /usr , /lib etc so I tried
> setting LD_LIBRARY_PATH in a shell but that doesnt seem to work for me. I am
> assuming that I need to set LD_LIBRARY_PATH in the shell created by
> monodevelops run command, so can someone tell me how to do this?
normaly yu can replace your dll call : libtest.so by libtest i folow
this way fro lib ported to Win 32 ex : libtest.so and libtest.dll
after , compile your prog with MD
open a shell (konsole for ex) and browse to the bin/Debug or Release
dir (depand how yu compile)
then : export LD_LIBRARY_PATH=LD_LIBRARY_PATH$:what yu need && mono ./your.exe
also i think, yu can call your test lib with an absolute path or
relative to your compil directory
>
> Thanks
> Alan
>
>
> Petit Eric wrote:
>>
>> P/Invoke
>>
>>
>> 2008/10/6 alanb <alan.battersby at ntlworld.com>:
>>>
>>> I tried adding a shared library as a reference to my C# project but it
>>> wasn't
>>> recognized. So is there a way to do this? If it is  not possible
>>> directly
>>> how do you wrap a .so file as a .dll that would be recognized?
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Newbie-question%3A-Making-a-reference-to-a-linux-shared-library-tp19835738p19835738.html
>>> Sent from the Mono - MonoDevelop IDE mailing list archive at Nabble.com.
>>>
>>> _______________________________________________
>>> Monodevelop-list mailing list
>>> Monodevelop-list at lists.ximian.com
>>> http://lists.ximian.com/mailman/listinfo/monodevelop-list
>>>
>>
>>
>>
>> --
>>
>> Cordially.
>>
>> Small Eric Quotations of the days:
>> ---------------------------------------------------------------------------
>> If one day one reproaches you that your work is not a work of
>> professional, say you that:
>> Amateurs built the arch of Noah, and professionals the Titanic.
>> ---------------------------------------------------------------------------
>>
>> Few people are done for independence, it is the privilege of the powerful
>> ones.
>> ---------------------------------------------------------------------------
>>
>> No key was wounded during the drafting of this message.
>> _______________________________________________
>> Monodevelop-list mailing list
>> Monodevelop-list at lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/monodevelop-list
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Newbie-question%3A-Making-a-reference-to-a-linux-shared-library-tp19835738p19836211.html
> Sent from the Mono - MonoDevelop IDE mailing list archive at Nabble.com.
>
> _______________________________________________
> Monodevelop-list mailing list
> Monodevelop-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/monodevelop-list
>



-- 

Cordially.

Small Eric Quotations of the days:
---------------------------------------------------------------------------
If one day one reproaches you that your work is not a work of
professional, say you that:
Amateurs built the arch of Noah, and professionals the Titanic.
---------------------------------------------------------------------------

Few people are done for independence, it is the privilege of the powerful ones.
---------------------------------------------------------------------------

No key was wounded during the drafting of this message.


More information about the Monodevelop-list mailing list