[Mono-list] Unable to  DllImporting libc.so
   
    Paolo Molaro
     
    lupus@ximian.com
       
    Tue, 26 Nov 2002 16:45:40 +0100
    
    
  
On 11/21/02 Adam Keys wrote:
> I am trying to implement a POSIX wrapper and so I need to DllImport
> libc.so.  Whenever I run my code[1] mono outputs the following:
> 
> ** (process:18635): WARNING **: Failed to load library libc.so (libc.so)
> 
> I've tried setting MONO_PATH and LD_LIBRARY_PATH to /usr/lib but I am
> still unable to load libc.so.  Copying libc.so to the working directory
> doesn't seem to help either.
> 
> I've attached[2] strace output of running mono.  Any idea what's going
> on here?  It looks like it fails to load ./libc.so and then tries
> /usr/lib/libc.so, successfully opens the file but then fails on calls to
> access(2).
Use DllImport ("libc"): mono will map it to the libc on your system
according to the dllmap entries in the mono config file (or you can add
an entry for libc.so as well).
man mono-config has more details (or look into mono/data/config.in in
the sources).
lupus
-- 
-----------------------------------------------------------------
lupus@debian.org                                     debian/rules
lupus@ximian.com                             Monkeys do it better