【问题标题】:Configure PKG_CONFIG_PATH for Mono on Mac在 Mac 上为 Mono 配置 PKG_CONFIG_PATH
【发布时间】:2010-12-12 02:04:02
【问题描述】:

我正在使用 Mac OS X,我正在尝试从网站 Mono Basics 运行以下代码:

using Gtk;
using System;

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

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

        Application.Run ();
    }
}

然后我使用以下命令进行编译:

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

我收到以下错误:

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.

我不知道包目录在我的计算机上的位置,所以我不知道将 PKG_CONFIG_PATH 设置为什么。你们有没有人在 Mac OS X 上使用过 Mono,你能指出我正确的方向,这些文件的位置以及我应该将 PKG_CONFIG_PATH 设置为什么?

【问题讨论】:

标签: macos path mono


【解决方案1】:

您要确保您的 pkg-config 包括:

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

我们默认发布的 pkg-config 确实包含这个,所以你的 PATH 中可能有我们之前的 macports 或 fink。

【讨论】:

  • 谢谢,我将它添加到 PKG_CONFIG_PATH 变量中,现在可以使用了。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2017-11-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多