[Mono-list] Starting out using mono

A Rafael D Teixeira rafael.teixeirabr@terra.com.br
Wed, 11 May 2005 15:39:04 -0300

Hi Jim see inline:

On Wed, 2005-05-11 at 01:01 -0400, jim lawrence wrote: 
> i tested out the sample hello.cs in the monodoc that compiled file and
> ran .  I found a example gtk.vb and tried to compile that as well. No
> good!  i get a error
> [jim@Notebook ~]$ mbas hello.vb -r gtk-sharp
> MonoBASIC Compiler - (c)2002, 2003, 2004, 2005 Rafael Teixeira
> --------
> --------
> error BC0006: Can not find assembly `gtk-sharp'
> Log:
> Compilation failed: 1 Error(s), 0 warnings

Well you need to tell mbas where the referenced assembly is like:

mbas hello.vb -r:/usr/lib/mono/gtk-sharp/gtk-sharp.dll

For your case where gtk-sharp is properly 'packaged' with a .pc file for
pkg-config, you can use:

mbas -pkg:gtk-sharp hello.vb

The pkg option looks for info on the .pc files and so it tells mbas the
correct path your libraries were installed and their names. On my system
the above command line means the same as:

mbas -r:/usr/lib/mono/gtk-sharp/glib-sharp.dll 
-r:/usr/lib/mono/gtk-sharp/gtk-sharp.dll hello.vb

You can also use the MONO_PATH environment variable (use 'man mono' tro
see documentation), but that isn't as good as it seems at first:

export MONO_PATH=.:/usr/lib/mono/gtk-sharp
mbas -r:gtk-sharp hello.vb

Rafael "Monoman" Teixeira 
Mono Hacker since 16 Jul 2001 - http://www.mono-project.com/
Mono Brasil Founding Member - http://monobrasil.softwarelivre.org/
Simios Proud Member - http://www.simios.org/ 
English Blog: http://monoblog.blogspot.com/
Brazilian Portuguese Blog: http://www.simios.org/blog/monoman