Configure PKG_CONFIG_PATH for Mono on Mac
I'm working on Mac OS X, and I'm trying to run the following code from the website Mono Basics:
using Gtk;
using System;
class Hello {
static void Main()
{
Application.Init ();
Window window = new Window ("helloworld");
window.Show();
Application.Run ();
开发者_开发知识库 }
}
I then compile with the following command:
gmcs hellogtk.cs -pkg:gtk-sharp-2.0
I get the following error:
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.
I don't know where the package directories are located on my computer, so I don't know what to set the PKG_CONFIG_PATH to. Have any of you guys worked with Mono on Mac OS X, and can you point me in the right direction as to where these files lie and what I should set PKG_CONFIG_PATH to?
You want to ensure your pkg-config includes:
/Library/Frameworks/Mono.framework/Versions/Current/lib/pkgconfig/
The pkg-config we ship by default does include this, so you probably have macports or fink prior to ours in your PATH.
精彩评论