tags:

views:

98

answers:

1

I am trying to compile my project with mono on linux. My cmd looks something like...

gmcs  Pages/UserProfile.cs   Properties/AssemblyInfo.cs   queues.cs   watch_editor.cs Class1.cs -define:USE_SQLITE -r:System -r:System.Collections -r:System.Collections.Generic -r:System.Collections.ObjectModel -r:System.Collections.Specialized -r:System.Configuration

but much long. and i get the output

error CS0006: cannot find metadata file `System.Collections'
error CS0006: cannot find metadata file `System.Collections.Generic'
error CS0006: cannot find metadata file `System.Collections.ObjectModel'
...

How do i solve this?

I also tried it the other way around (below) and had the same error msg with .dll at the end of them

gmcs   -define:USE_SQLITE -r:System.dll -r:System.Collections.dll  -r:System.Web.UI.WebControls CommentCenter.cs   cookies.cs   db.cs   Default.aspx.cs 
+4  A: 

You are confusing assemblies and namespaces. An assembly, such as System.dll, is a binary library file that can contain types in multiple namespaces. A namespace can be split across multiple assemblies, and the assembly name doesn't have to match the namespaces in any way.

-r is for referencing assemblies. You do not need to reference namespaces.

Given that most of the classes in those namespaces are in mscorlib (which is referenced by default) or System.dll, you probably just want

gmcs  Pages/UserProfile.cs   Properties/AssemblyInfo.cs   queues.cs   watch_editor.cs Class1.cs -define:USE_SQLITE -r:System

I strongly suggest you use an IDE such as MonoDevelop. You can view the compiler commands it generates, if you're interested.

mhutch
MonoDevelop isnt working ATM. Apparently other people had trouble and there was no simple solution (it seems)
acidzombie24
Maybe you'd better ask a question about that problem too?
mhutch