Compilation problems

There are many reasons for compilation errors to occur and they fall into one of three areas

Dependancies

Dependancy errors are the simplest to sort out. Check the dependancies page to ensure that you have everything installed that is required. Normally, when you run the autogen.sh script, that will inform you if you have something missing or some code you have is too old, but that doesn't always happen.

Source code

Source code errors only normally occur when using the development branch. It is very rare (though not unheard of) for them to occur in the stable branch.

If you are using the development branch you should report the fault (with the compiler error [obtainable by typing make 2>errors.txt instead of just make). The developer branch is updated roughly every hour, so it is likely to be fixed. The mono-devel-list is the place source code compilation failures should be reported

Conflicts & age

One of the most common forms of compile failure is the dreaded out-of-sync error. This is when corlib is out of sync (you get an error along the lines of corlib is out of date. Found version 22 and expected version 28. Luckily this is easy to rectify. Download the latest monocharge tar ball from go-mono.com/daily, dearchive, change to su and run the recharge.sh script.

That will fix the out of sync error.

The other conflict you may find is when you have more than one version of mono installed on your machine (for instance, you have installed mono in both /usr/local and /usr). The simplest way to get around this is to type (in a terminal window)

which mono

That will tell you where the mono binary is. The problem comes if the versions you have vary greatly (say you have 1.0.5 in /usr/local and 1.1.3 in /usr). To determine which version you have have type

mono --version

That should tell you the version number of mono reported by which. If the version reported in which was for /usr/local/bin/mono, then you should then type

/usr/bin/mono --version

Whichever version you want to keep, delete the other one. So to keep the one installed in /usr...

rm -rf /usr/local/lib/mono
cd /usr/local/bin
rm -f mono mcs gmcs gapi* gac*

And you should be okay then.

Finally, if you are told by the configure script that you need a version of glib2.2 or newer, then that does not relate to the glib2 or glib rpm packages installed on your system (or whatever it is called for your particular distro). It is referring to the glibc package! This has caught quite a few people out!