[Mono-list] Unable to compile Stack<string> variable on mcs on Ubuntu: Help Please

Jon Chambers joncham at gmail.com
Thu Oct 5 19:55:04 EDT 2006


That should be System.Collections.Generic:

http://msdn2.microsoft.com/en-us/library/system.collections.generic.aspx

On 10/5/06, Xeno Campanoli <xeno at eskimo.com> wrote:
>
> Jon Chambers wrote:
> > You need to compile using gmcs, not mcs in order to use 2.0 features.
> Try:
> >
> > gmcs try003.cs
> Here's the results of my try (It did compile and work when I commented
> out the "using System.Collections.Generics;" line):
>
> xeno at radioflyer:~/study/puzz/cs$ gmcs -debug try003.cs
> try003.cs(5,7): error CS0234: The type or namespace name `Generics'
> does not exist in the namespace `System.Collections'. Are you missing an
> assembly reference?
> try003.cs(5,1): error CS0246: The type or namespace name
> `Collections.Generics' could not be found. Are you missing a using
> directive or an assembly reference?
> Compilation failed: 2 error(s), 0 warnings
> xeno at radioflyer:~/study/puzz/cs$
>
>
> >
> > Thanks,
> > Jonathan
> >
> > On 10/5/06, *Xeno Campanoli* < xeno at eskimo.com
> > <mailto:xeno at eskimo.com>> wrote:
> >
> >     I get the following diagnostic trying to compile code I cite at the
> >     bottom of this message:
> >
> >     xeno at radioflyer:~/study/puzz/cs$ mcs -debug try003.cs
> >     try003.cs(22,15): error CS8025: Parsing error
> >     Compilation failed: 1 error(s), 0 warnings
> >     xeno at radioflyer:~/study/puzz/cs$
> >
> >     You can also see I have the Generic using line commented out
> >     because it
> >     yields the following diagnostic when line 22 is commented out:
> >
> >     xeno at radioflyer:~/study/puzz/cs$ mcs -debug try003.cs
> >     try003.cs(5,7): error CS0234: The type or namespace name `Generics'
> >     does not exist in the namespace `System.Collections'. Are you
> >     missing an
> >     assembly reference?
> >     try003.cs(5,1): error CS0246: The type or namespace name
> >     `System.Collections.Generics' could not be found. Are you missing a
> >     using directive or an assembly reference?
> >     Compilation failed: 2 error(s), 0 warnings
> >     xeno at radioflyer:~/study/puzz/cs$
> >
> >     Here is the source file:
> >
> -----------------------------------------------------------------------
> >
> >     // BTreeTry
> >
> >     using System;
> >     using System.Collections;
> >     //using System.Collections.Generics;
> >     using System.Text;
> >
> >     namespace BTreeTrySpace {
> >
> >     public class BTreeNode
> >     {
> >     public BTreeNode Left;
> >     public BTreeNode Right;
> >     public string VALUE;
> >     }
> >
> >     public class BTreeUtil
> >     {
> >     // Everything else is at the class level, so same here to be
> >     consistent.
> >     public const int MAXDEPTH = 32;
> >     //public Stack<string> sFlagStack;
> >     public stack<Int32> intStack = new Stack<Int32>(); // line 22
> >     // public static BTreeNode sNodeStack[];
> >     // public static int sNodeDepth;
> >
> >     }
> >
> >     class BTreeTry {
> >     static void Main()
> >     {
> >     // Use the system console object
> >     System.Console.WriteLine("Hello, Java!");
> >     }
> >     }
> >     }
> >     // end of BTreeTry
> >
> -----------------------------------------------------------------------------------------------------
> >
> >
> >     --
> >     Support Instant Runoff Voting! YES ON 3:
> >     1. Cut off Mudslinging Politics!
> >     2. Bring back real Democracy!
> >
> >     _______________________________________________
> >     Mono-list maillist - Mono-list at lists.ximian.com
> >     <mailto:Mono-list at lists.ximian.com>
> >     http://lists.ximian.com/mailman/listinfo/mono-list
> >
> >
>
>
> --
> Support Instant Runoff Voting!  YES ON 3:
>         1.  Cut off Mudslinging Politics!
>         2.      Bring back real Democracy!
>
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20061005/c19b0f51/attachment.html 


More information about the Mono-list mailing list