[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mono-list
Subject:    [Mono-list] System.DllNotFoundException
From:       "Martin Welch" <martin () welch ! eclipse ! co ! uk>
Date:       2004-04-08 18:39:46
Message-ID: GIEKKMAAMELBNKEJJKHGCEJACMAA.martin () welch ! eclipse ! co ! uk
[Download RAW message or body]

I have a simple c# app trying to PInvoke to a shared library on my Mandrake
10 box using Mono-0.31.

I assumed that mono would look in the current directory but it seems my
assumption is wrong since the so in question does exist.

I'm even hardcoding the path in my DllImport attribute:

  [
  DllImport
  (
  "/home/martin/source/foo",
  EntryPoint="MyFunc",
  CharSet=CharSet.Ansi,
  CallingConvention=CallingConvention.Cdecl
  )
  ]
  private static extern IntPtr MyFunc(int v,
[MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStr)]
string[] a, string n);

Please bear in mind that I'm not a very experienced linux user so in all
likelihood I've done something profoundly stupid or overlooked something
really obvious.

Where does mono look for so's?

Thanks,

Martin

[Attachment #3 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Verdana size=2><SPAN class=128442718-08042004>I have a simple c# 
app trying to PInvoke to a shared library on my Mandrake 10 box using 
Mono-0.31.</SPAN></FONT></DIV>
<DIV><FONT face=Verdana size=2><SPAN 
class=128442718-08042004></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Verdana size=2><SPAN class=128442718-08042004>I assumed that 
mono would look in the current directory but it seems my assumption is wrong 
since the so in question does exist.</SPAN></FONT></DIV>
<DIV><FONT face=Verdana size=2><SPAN 
class=128442718-08042004></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Verdana size=2><SPAN class=128442718-08042004>I'm even 
hardcoding the path in my DllImport attribute:</SPAN></FONT></DIV>
<DIV><FONT face=Verdana size=2><SPAN 
class=128442718-08042004></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Verdana size=2><SPAN 
class=128442718-08042004>&nbsp;&nbsp;[<BR>&nbsp;&nbsp;DllImport<BR>&nbsp;&nbsp;(<BR>&nbsp;&nbsp;"/home/martin/source/foo", \
 <BR>&nbsp;&nbsp;EntryPoint="MyFunc", <BR>&nbsp;&nbsp;CharSet=CharSet.Ansi, 
<BR>&nbsp;&nbsp;CallingConvention=CallingConvention.Cdecl<BR>&nbsp;&nbsp;)<BR>&nbsp;&nbsp;]<BR>&nbsp;&nbsp;private \
 static extern IntPtr MyFunc(int v, [MarshalAs(UnmanagedType.LPArray, 
ArraySubType=UnmanagedType.LPStr)] string[] a, string 
n);<BR></SPAN></FONT></DIV>
<DIV><FONT face=Verdana size=2><SPAN class=128442718-08042004>Please bear in 
mind that I'm not a very experienced linux user so in all likelihood I've done 
something profoundly stupid or overlooked something really 
obvious.</SPAN></FONT></DIV>
<DIV><FONT face=Verdana size=2><SPAN 
class=128442718-08042004></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Verdana size=2><SPAN class=128442718-08042004><SPAN 
class=128442718-08042004>Where does mono look for so's? 
</SPAN></SPAN></FONT></DIV>
<DIV><FONT face=Verdana size=2><SPAN class=128442718-08042004><SPAN 
class=128442718-08042004></SPAN></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Verdana size=2><SPAN class=128442718-08042004><SPAN 
class=128442718-08042004>Thanks,</SPAN></SPAN></FONT></DIV>
<DIV><FONT face=Verdana size=2><SPAN class=128442718-08042004><SPAN 
class=128442718-08042004></SPAN></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Verdana size=2><SPAN class=128442718-08042004><SPAN 
class=128442718-08042004>Martin</SPAN></DIV></SPAN></FONT></BODY></HTML>


_______________________________________________
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic