Common Problems with Mono (see the bottom) ------------------------------------------ (c) 2002, Jaime Anguiano Olarra 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 http://mono.baselabs.org/index.php/software. See http://www.go-mono.com/download 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 Ximian Bugzilla 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 download page?. You need CygWin among other things. Check all of that before trying to compile.