2010-12-12 2 views
4

Je travaille sur Mac OS X, et je suis en train d'exécuter le code suivant à partir du site Mono Basics:Configurer PKG_CONFIG_PATH pour Mono sur Mac

using Gtk; 
using System; 

class Hello { 
    static void Main() 
    { 
     Application.Init(); 

     Window window = new Window ("helloworld"); 
     window.Show(); 

     Application.Run(); 
    } 
} 

je compile puis avec la commande suivante:

gmcs hellogtk.cs -pkg:gtk-sharp-2.0 

je reçois l'erreur suivante:

Package gtk-sharp-2.0 was not found in the pkg-config search path. 
Perhaps you should add the directory containing `gtk-sharp-2.0.pc' 
to the PKG_CONFIG_PATH environment variable 
No package 'gtk-sharp-2.0' found 
error CS8027: Error running pkg-config. Check the above output. 

Je ne sais pas où les répertoires de paquets sont situés sur mon ordinateur, donc je ne sais pas à quoi définir le PKG_CONFIG_PATH. Est-ce que l'un d'entre vous a travaillé avec Mono sur Mac OS X, et pouvez-vous me dire dans quelle direction ces fichiers se trouvent et à quoi dois-je mettre PKG_CONFIG_PATH?

+0

* Avez-vous déjà installé GTK #? –

+0

J'ai téléchargé d'ici: http://www.go-mono.com/mono-downloads/download.html. Je ne sais pas si ça vient avec GTK #. Ai-je besoin de télécharger GTK +, aussi? – dbmikus

Répondre

5

Vous voulez vous assurer que votre pkg-config comprend:

/Library/Frameworks/Mono.framework/Versions/Current/lib/pkgconfig/

Le pkg-config nous transportons par défaut ne comprend ce , donc vous avez probablement macports ou fink avant le nôtre dans votre PATH.

+0

Merci, j'ai ajouté cela à la variable PKG_CONFIG_PATH et cela fonctionne maintenant. – dbmikus