Windows Develop Bookmark and Share   
 index > Windows Forms Sample Applications > Error compiling
 

Error compiling

Hello all,

I am new to all this (C#, .NET, Terrarium), and I have tried as a startup exercise to compile the code of a plant to see how complex it can be.
I have copied this code from the Terrarium farm and tried to compile it, just to note that I consistently have an error that I cannot get rid of. I only have the .NET SDK tools, so I  am compiling with the command line version.

I am getting this errors when I compile:
D:\costapaul\My Documents\Terrarium\Plants>csc /t:library /debug+ /out:plant.dll
 /r:System.dll,System.Drawing.dll,OrganismBase.dll plant.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.

plant.cs(15,23): error CS0246: The type or namespace name 'Plant' could not be
        found (are you missing a using directive or an assembly reference?)
plant.cs(11,2): error CS0246: The type or namespace name 'MaximumEnergyPoints'
        could not be found (are you missing a using directive or an assembly
        reference?)
plant.cs(12,2): error CS0246: The type or namespace name 'MatureSize' could not
        be found (are you missing a using directive or an assembly reference?)
plant.cs(13,2): error CS0246: The type or namespace name
        'SeedSpreadDistanceAttribute' could not be found (are you missing a
        using directive or an assembly reference?)
plant.cs(10,12): error CS0246: The type or namespace name 'OrganismClass' could
        not be found (are you missing a using directive or an assembly
        reference?)

Can anyone give me an hint on what to check to solve this problem? I have also tried to compile an animal but these errors also happen for the Animal namespace. 

Thank you!
Paulo

---(The compilation command line)---
csc /t:library /debug+ /out:plant3.dll /r:System.dll,System.Drawing.dll,OrganismBase.dll plant.cs

---(The Code)---
using System;
using System.Collections;
using System.Drawing;
using System.IO;


// Plants are very boring, but they are necessary, 
// especially when you introduce a herbivore into an empty Terrarium

[assembly: OrganismClass("Foood3")]
[MaximumEnergyPoints(10)]
[MatureSize(26)]
[SeedSpreadDistanceAttribute(100)]

public class Foood3 : Plant {
    public override void SerializePlant(MemoryStream m) {
    }
    public override void DeserializePlant(MemoryStream m) {
    }
}

MigrationUser 1  Thursday, December 16, 2004 4:21 AM
Ok,
I have found what the problem is, the source code is missing a using OrganismBase; after the other using clauses.
I have inserted this line and now is working.

Thank you anyway to you all.

MigrationUser 1  Friday, December 17, 2004 4:19 AM

You can use google to search for other answers

Custom Search

More Threads

• Trouble with <Null> values in Date Fields
• c#?
• How to develop a IDE in C# and .net
• Windows service databse problem
• No Animals teleport to my machine.
• Server
• "The terrarium server is experiencing temporary difficulties. This is probably why you are not receiving any animals. Please bear with us while we get the issue resolved."
• Unable to Install TV Server on Windows Server 2003 Std.
• Terrarium RTC Chat in Beta!
• How to Set Tooltip to Combobox Item at Binding Time in vb.net