1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
|
Common Problems with Mono (see the bottom)
------------------------------------------
(c) 2002, Jaime Anguiano Olarra
<jaime@geneura.ugr.es>
Getting it:
There are several ways to get Mono running on your computer.
Although the purpose of this document I will add some info
here for completness. After all you need the software if you
want to get in trouble :).
RPMs or DEBs can be found at Baselabs <a href="http://mono.baselabs.org/index.php/software">http://mono.baselabs.org/index.php/software</a>.
See <a href="http://www.go-mono.com/download">http://www.go-mono.com/download</a> for more information.
Installing it:
Here comes the real fun. This is what some people have claimed for as
a 'foolproff way to get started'.
First, assume you have the packages.
You must know that:
1.- Mono can be compiled in Linux and Windows but mcs
cannot. Please don't write to the list telling that
you have downloaded the mcs-X.XX.tar.gz and that
you can't build it. It's a 'status' problem. The
mcs compiler can't be compiled under Linux yet.
This means, entering in mcs-X.XX and running 'make'
will show you something as:
[jaime@localhost mcs-0.12]$ make
for i in jay nant mcs class nunit tools; do
\ (cd $i; make linux) || exit 1; \
done
make[1]: Cambiando a directorio `/home/jaime/utils/mcs-0.12/jay'
make[1]: No se hace nada para `linux'.
make[1]: Saliendo directorio `/home/jaime/utils/mcs-0.12/jay'
make[1]: Cambiando a directorio `/home/jaime/utils/mcs-0.12/nant'
csc /out:NAnt.exe /recurse:*.cs
/bin/sh: csc: command not found
make[1]: *** [NAnt.exe] Error 127
make[1]: Saliendo directorio `/home/jaime/utils/mcs-0.12/nant'
make: *** [linux] Error 1
2.- You need to get the packages refered in the Mono
download page. These are: glib 1.3, pkgconfig...
Second, read all the READMEs and INSTALLs.
For short, you will normally will be able to install the RPMs and DEBs as
usual:
rpm -Uhv mono-X.XX_baselabs-XXXXXXXX.rpm
See the BaseLabs page for a full explanation.
Building your own binaries it's easy too!.
Unzip and untar the tarball (will work only for Mono, remember!!)
tar -zxvf mono-X.XX.tar.gz
Enter the directory where the sources reside:
cd mono-X.XX
Run the configure script:
./configure.in
Then make the package:
make
Now you are able to install it:
make install
Remember once again. mcs cannot be compiled under Linux. You need a Windows system
where to build it. The only way for you to get the mcs in Linux without building
it by your own in a Windows machine (including the VMWare alternative) is to install
the binaries from the BaseLabs page. It's also important to say that there are
NUnit packages too in that site but that you probably won't need to care about that
if you are reading this document.
Running it:
If you want to compile a little program using the mcs, let's say "konnichiwa.cs"
do this:
mcs konnichiwa.cs
The output will depend on wether your program is compilable or not, if it is a
"RESULT: 0" will be printed in your gnome-terminal (or whatever 'console' you use).
You should see a file called "konnichiwa.exe" in the same directory (folder) where
the source (konnichiwa.cs) is.
To run the binary you have to options. The most used is:
mono konnichiwa.exe
but it might be better to use this other approach instead (calling the interpreter):
mint konnichiwa.exe
That's it. The Mono mcs compiler allows you to perform more complicated compilations
and I will show an example using three source files. Suppose you have three files:
person.cs, employee.cs, Test.cs. The first one could contain an abstract class Person
while the second one could be the source for a concrete class derived from Person and
called Employee. The last one, Test.cs could be a simple class to show how the classes
work and it contains an entry point (the Main() method, signed with the appropiate
attributes 'public static' and the correct type 'void'). Then you could get the
Text.exe program by calling:
mcs Test.cs person.cs employee.cs
You might want to see my slides, source code and other material from the course on
CSharp I am preparing to teach at the University of Granada, Spain. If you are a newbie
HTH.
A note about problems:
First see the <a href="http://bugzilla.ximian.com">Ximian Bugzilla</a> page in order
to get know if the bug has already been reported.
Second, read this document.
Third, visit the mono mailing lists' archives and do a little research in there for
threads talking about the problems you are having.
Fourth if you still cannot override the problem, contact the lists.
Known problems:
1.- mcs fails to compile in Linux.
sol. mcs cannot compile in Linux. Try to install the already made packages
from http://mono.baselabs.org/index.php/software
2.- mono fails to compile in my Linux box.
sol. Uhg... a generic 'question'. Proceed as above. (note for geeks: GOTO: 1.-)
3.- I cannot install mono under RedHat 7.3.
sol. Try to upgrade your libc6 packages. In general, check that you have the
right versions for the packages glib, pkgconfig, libc...
4.- I cannot compile mcs nor mono under Windows. Are you fooling me?.
sol. No, we are not. Have you read carefully the <a href="http://www.go-mono.com">download</a>
page?. You need CygWin among other things. Check all of that before
trying to compile.
|