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

Jon Chambers joncham at gmail.com
Thu Oct 5 19:44:32 EDT 2006


You need to compile using gmcs, not mcs in order to use 2.0 features. Try:

gmcs try003.cs

Thanks,
Jonathan

On 10/5/06, Xeno Campanoli <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
> 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/ab3c39a6/attachment.html 


More information about the Mono-list mailing list