[Mono-list] Error CS0246: Cannot find type 'MyClass'

Uppenborn, Jason Jason.Uppenborn@atcoitek.com
Fri, 9 Jan 2004 16:54:12 -0700


Hi.

I'm trying to reference a class I built from another class, and I'm
getting a "CS0246: Cannot find type" error. My simplified code and an
attempt to compile it are shown below. FYI, I'm using Mono-0.28 as
installed by the Windows installer on WinXP.

----- snip -----
M:\MONO\SOURCE>type MyLib.cs
using System;

namespace MyLib {

class MyClass {

   public String GetString() {
      return "SomeString";
   }

} // MyClass

} // MyLib

M:\MONO\SOURCE>mcs /r:System /t:library MyLib.cs
Compilation succeeded

M:\MONO\SOURCE>type TestMyLib.cs
using System;
using MyLib;

class TestClass {
   public static void Main( String[] args ) {
      MyClass mc =3D new MyClass();
      Console.WriteLine("Testing: {0}", mc.GetString());
   }
} // TestClass

M:\MONO\SOURCE>mcs /r:System -L "." /r:MyLib TestMyLib.cs
TestMyLib.cs(6) error CS0246: Cannot find type `MyClass'
Compilation failed: 1 error(s), 0 warnings
----- snip -----

All help will be appreciated.

Jason