Como posso compilar o mono Hello World?

2

Eu tenho o Ubuntu 11.04 com este mono:

Mono JIT compiler version 2.6.7 (Debian 2.6.7-5ubuntu3)
Copyright (C) 2002-2010 Novell, Inc and Contributors. www.mono-project.com
    TLS:           __thread
    GC:            Included Boehm (with typed GC and Parallel Mark)
    SIGSEGV:       altstack
    Notifications: epoll
    Architecture:  x86
    Disabled:      none

Estou tentando executar isso:

using System;

public class HelloWorld
{
    static public void Main ()
    {
        Console.WriteLine ("Hello Mono World");
    }
}

e eu recebo esses erros:

ThinkPad-X201-Tablet:~/Desktop$ gmcs hello.cs
** (/usr/lib/mono/2.0/gmcs.exe:9128): WARNING **: Missing method .ctor in assembly /usr/lib/mono/2.0/gmcs.exe, type System.Runtime.CompilerServices.CompilerGeneratedAttribute
** (/usr/lib/mono/2.0/gmcs.exe:9128): WARNING **: The class System.Runtime.CompilerServices.CompilerGeneratedAttribute could not be loaded, used in gmcs
** (/usr/lib/mono/2.0/gmcs.exe:9128): WARNING **: Can't find custom attr constructor image: /usr/lib/mono/2.0/gmcs.exe mtoken: 0x0a0003d2
** (/usr/lib/mono/2.0/gmcs.exe:9128): WARNING **: Missing method .ctor in assembly /usr/lib/mono/2.0/gmcs.exe, type System.Runtime.CompilerServices.CompilerGeneratedAttribute
** (/usr/lib/mono/2.0/gmcs.exe:9128): WARNING **: Can't find custom attr constructor image: /usr/lib/mono/2.0/gmcs.exe mtoken: 0x0a0003d2
** (/usr/lib/mono/2.0/gmcs.exe:9128): WARNING **: Missing method .ctor in assembly /usr/lib/mono/2.0/gmcs.exe, type System.Runtime.CompilerServices.CompilerGeneratedAttribute
** (/usr/lib/mono/2.0/gmcs.exe:9128): WARNING **: Can't find custom attr constructor image: /usr/lib/mono/2.0/gmcs.exe mtoken: 0x0a0003d2
** (/usr/lib/mono/2.0/gmcs.exe:9128): WARNING **: Missing method .ctor in assembly /usr/lib/mono/2.0/gmcs.exe, type System.Runtime.CompilerServices.CompilerGeneratedAttribute
** (/usr/lib/mono/2.0/gmcs.exe:9128): WARNING **: Can't find custom attr constructor image: /usr/lib/mono/2.0/gmcs.exe mtoken: 0x0a0003d2
** (/usr/lib/mono/2.0/gmcs.exe:9128): WARNING **: Missing method .ctor in assembly /usr/lib/mono/2.0/gmcs.exe, type System.Runtime.CompilerServices.CompilerGeneratedAttribute
** (/usr/lib/mono/2.0/gmcs.exe:9128): WARNING **: Can't find custom attr constructor image: /usr/lib/mono/2.0/gmcs.exe mtoken: 0x0a0003d2
** (/usr/lib/mono/2.0/gmcs.exe:9128): WARNING **: Missing method .ctor in assembly /usr/lib/mono/2.0/gmcs.exe, type System.Runtime.CompilerServices.CompilerGeneratedAttribute
** (/usr/lib/mono/2.0/gmcs.exe:9128): WARNING **: Can't find custom attr constructor image: /usr/lib/mono/2.0/gmcs.exe mtoken: 0x0a0003d2
** (/usr/lib/mono/2.0/gmcs.exe:9128): WARNING **: Missing method .ctor in assembly /usr/lib/mono/2.0/gmcs.exe, type System.Runtime.CompilerServices.CompilerGeneratedAttribute
** (/usr/lib/mono/2.0/gmcs.exe:9128): WARNING **: Can't find custom attr constructor image: /usr/lib/mono/2.0/gmcs.exe mtoken: 0x0a0003d2
Unhandled Exception: System.TypeLoadException: A type load exception has occurred.

Alguma idéia?

    
por Danpe 19.09.2011 / 09:27

1 resposta

3

Compila perfeitamente na minha configuração.

Você deve ter este pacote instalado:

  • mono-2.0-devel

Isso deve chamar todas as dependências necessárias para uma compilação de linha de comando. Se você quiser mais conforto, eu recomendaria instalar o pacote monodevelop.

    
por aquaherd 19.09.2011 / 19:09

Tags