[Mono-list] Using Mono

Miguel de Icaza miguel@ximian.com
29 Mar 2002 00:43:03 -0500


> I compile this with "mcs --target library Complex.cs" and it creates
> "Complex.dll"
> 
> Then I wrote a program to use it:
> 
> class CompExample {
> 	static void Main() {
> 		Complex comp1 = new Complex(1,2);
> 	}
> }
> 
> 1) First question:
> 
>    Is this the right way to compile my test program?
> 
> prompt]$ mcs -r Complex.dll ExampleComp.cs
> RESULT: 0

Yes, that is correct.  

> 2) Second quesiton:
> 
>    How do I tell Mono to look for the library in the current directory?

That is a very good question.  Currently the runtime only looks for
assemblies on the installation directory.  We should change the code to
also look up in other directories.

This is a bug, because we should at least be able to locate modules that
are part of the assembly.

> prompt]$ mono ExampleComp.exe
> 
> (process:13083): ** WARNING **: tree does not match
>  (STIND_R8 (ADD (LDIND_REF ADDR_L[1]) CONST_I4) CONST_I4)
> 
>         (STIND_R8 (ADD (LDIND_REF ADDR_L[1]) CONST_I4) CONST_I4)
>         (STIND_R8 (ADD (LDIND_REF ADDR_L[1]) CONST_I4) CONST_I4)
>         (CALL_VOID (LDIND_REF ADDR_L[1]) ADDR_G)
>         (STIND_R8 (ADD (LDIND_REF ADDR_L[1]) CONST_I4) (LDIND_R8
> ADDR_L[2]))
>         (STIND_R8 (ADD (LDIND_REF ADDR_L[1]) CONST_I4) (LDIND_R8
> ADDR_L[3]))
>         RET_VOID

This means that the JIT could not find a match for the code that you
wrote, it should be taken care of soon.