[Mono-list] Mono libraries

A Rafael D Teixeira rafael.teixeirabr@terra.com.br
Thu, 16 Dec 2004 12:28:07 -0200


On Wed, 2004-12-15 at 12:29, Martin Hansen wrote:
> Hi All
> 
> I downloaded mcs-1.0.4, and it compiled fine.
> 
> But I cannot figure out how to convince mcs/mono to use the libraries that I compiled.
> I knoe that the is a switch for mcs -L or -lib: but they will not stop mcs to search in standard libs too. As I tried:
> mcs -lib:/home/notexistingdir Main.cs
> And it compiled.
> 
> I also tried 
> mcs -nostdlib -lib:~/monotest/lib Main.cs
> but that would not compile
> 
> First time I compilled there where just a set of links in ~/monotest/lib pointing to the ones in /usr/lib. Then I set the LIBRARY_INSTALL_DIR=~/monotest/lib and ran make now I got the asemblies in there.
> 
> Am I wrong in doing this?

The -lib: command line option just adds paths to search for referenced
libs, but doesn't tell mcs which libs you want to use.

For that you have to reference them using -r:. 

While doing so it's better to fully qualify the reference so that you
will get the correct version of it, instead of relying on -lib:,
specially if you some of your libs have the same filename as some other
living in some directory from the MONO_PATH list or installed in the
GAC.

Example:

mcs -nostdlib -r:/monotest/lib/myownlib1.dll -r:/monotest/lib/System.dll Main.cs

Also, using -nostdlib means you'll have to reference some version of
System.dll and System.Xml.dll by hand if you need some thing inside them
(and most of time you need).

Hope it clarifies things a little more.

-- 
Rafael "Monoman" Teixeira 
Mono Hacker since 16 Jul 2001 - http://www.go-mono.org/
Mono Brasil Founding Member - http://monobrasil.redesolbrasil.org/
English Blog: http://monoblog.blogspot.com/
Brazilian Portuguese Blog: http://monoblog.weblogger.terra.com.br/