[Mono-list] Error: mcs.exe: cannot execute binary file

Jaime Anguiano Olarra jaime@geneura.ugr.es
16 Jun 2002 20:22:21 +0200

Content-Type: multipart/mixed; boundary="=-38tYyJhDoXuil9dca2oU"

Content-Type: text/plain; charset=ISO-8859-15
Content-Transfer-Encoding: quoted-printable

Here is the first version of the mono-common-problems.

I will upload it to the cvs right know, also I will add a link in the



El dom, 16-06-2002 a las 02:15, Jose Cornado escribi=F3:
> Monos:
> 	I've just downloaded 0.12 mono/mcs. Finished making mono. When I try to
> make mcs, Nant throws an error that csc can not be found. I changed makef=
> to use mcs instead of csc (I am running rh 7.2 no cygwin at all) then it
> throws some garbage message. To be sure I typed $mcs.exe and I get the er=
> on the subject line. Any ideas, hitns?
> _______________________________________________
> Mono-list maillist  -  Mono-list@ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
// http://geneura.ugr.es -- The Geneura Team
// http://www.go-mono.com -- The Mono Project

Content-Disposition: attachment; filename=mono-common-problems
Content-Type: text/plain; name=mono-common-problems; charset=ISO-8859-15
Content-Transfer-Encoding: quoted-printable

	Common Problems with Mono (see the bottom)

	(c) 2002, Jaime Anguiano Olarra=20

Getting it:

	There are several ways to get Mono running on your computer.=20
	Although the purpose of this document I will add some info=20
	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=3D"http://mono.baselabs.org/=

	See <a href=3D"http://www.go-mono.com/download">http://www.go-mono.com/dow=
nload</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=20
		    you can't build it. It's a 'status' problem. The=20
		    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 				=09
			\	(cd $i; make linux) || exit 1;	\
			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=20
			/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=20
		    download page. These are: glib 1.3, pkgconfig...

	Second, read all the READMEs and INSTALLs.=20

		For short, you will normally will be able to install the RPMs and DEBs as

			rpm -Uhv mono-X.XX_baselabs-XXXXXXXX.rpm

		See the BaseLabs page for a full explanation.=20

		Building your own binaries it's easy too!.=20
		Unzip and untar the tarball (will work only for Mono, remember!!)
			tar -zxvf mono-X.XX.tar.gz=20

		Enter the directory where the sources reside:

			cd mono-X.XX

		Run the configure script:


		Then make the package:


		Now you are able to install it:

			make install

	Remember once again. mcs cannot be compiled under Linux. You need a Window=
s system
	where to build it. The only way for you to get the mcs in Linux without bu=
	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=
	NUnit packages too in that site but that you probably won't need to care a=
bout that
	if you are reading this document.

Running it:

	If you want to compile a little program using the mcs, let's say "konnichi=
	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 (folde=
r) 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 int=

		mint konnichiwa.exe

	That's it. The Mono mcs compiler allows you to perform more complicated co=
	and I will show an example using three source files. Suppose you have thre=
e files:
	person.cs, employee.cs, Test.cs. The first one could contain an abstract c=
lass 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 ap=
	attributes 'public static' and the correct type 'void'). Then you could ge=
t the=20
	Text.exe program by calling:=20

		mcs Test.cs person.cs employee.cs

	You might want to see my slides, source code and other material from the c=
ourse on
	CSharp I am preparing to teach at the University of Granada, Spain. If you=
 are a newbie
A note about problems:

	First see the <a href=3D"http://bugzilla.ximian.com">Ximian Bugzilla</a> p=
age in order=20
	to get know if the bug has already been reported.

	Second, read this document.=20

	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:   =09

	1.- mcs fails to compile in Linux.=20

		sol. mcs cannot compile in Linux. Try to install the already made package=
			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: GOT=
O: 1.-)

	3.- I cannot install mono under RedHat 7.3.

		sol. Try to upgrade your libc6 packages. In general, check that you have =
			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=3D"http://www.go=
			page?. You need CygWin among other things. Check all of that before=20
			trying to compile.



Content-Type: application/pgp-signature; name=signature.asc
Content-Description: Esta parte del mensaje esta firmada digitalmente

Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org