[Mono-list] Compiling egg-chicken libraries

Jonathan Gilbert 2a5gjx302@sneakemail.com
Fri, 27 Feb 2004 02:32:36


At 09:52 AM 26/02/2004 -0500, you wrote:
[snip]
>For example, if you need to have:
>
>Stub:
>
>abstract class Foo {
>     abstract MyClass Doit (int i);
>}
>
>Object:
>class MyClass {}
>classy MyFoo : Foo {
>    override MyClass DoIt (int i) {}
>}
>
>I don't think there is a way to bootstrap this. (well, there are some
hacks you can do with IL code, however, it is very messy).
[snip]

1. Create Object.cs containing only:

class MyClass {}

2. Compile this.

3. Compile Stub against this.

4. Compile the true Object against Stub.

..or just pass both .cs files to the C# compiler at the same time -- works
with CSC at least :-)

[x:\test\testinterdependence]csc /target:module Object.cs
Microsoft (R) Visual C# .NET Compiler version 7.10.3052.4
for Microsoft (R) .NET Framework version 1.1.4322
Copyright (C) Microsoft Corporation 2001-2002. All rights reserved.

Object.cs(5,17): error CS0246: The type or namespace name 'Foo' could not be
        found (are you missing a using directive or an assembly reference?)

[x:\test\testinterdependence]csc /target:module Stub.cs
Microsoft (R) Visual C# .NET Compiler version 7.10.3052.4
for Microsoft (R) .NET Framework version 1.1.4322
Copyright (C) Microsoft Corporation 2001-2002. All rights reserved.

Stub.cs(5,21): error CS0246: The type or namespace name 'MyClass' could not be
        found (are you missing a using directive or an assembly reference?)

[x:\test\testinterdependence]csc /target:module Object.cs Stub.cs
Microsoft (R) Visual C# .NET Compiler version 7.10.3052.4
for Microsoft (R) .NET Framework version 1.1.4322
Copyright (C) Microsoft Corporation 2001-2002. All rights reserved.


[x:\test\testinterdependence]dir

 Volume in drive X is ELLIANA        Serial number is DCCB:1835
 Directory of  X:\test\TestInterdependence\*

27/02/04   2:20         <DIR>    .
27/02/04   2:20         <DIR>    ..
27/02/04   2:18             140  Object.cs
27/02/04   2:20           2,048  Object.netmodule
27/02/04   2:18              94  Stub.cs
          2,282 bytes in 3 files and 2 dirs    12,288 bytes allocated
  1,963,778,048 bytes free

[x:\test\testinterdependence]

The resulting module contains types from both .cs files, of course.

Jonathan