macos - 在 Mac 上为 Mono 配置 PKG_CONFIG_PATH

标签 macos path mono

我在 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 设置为什么?

最佳答案

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

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

我们默认提供的 pkg-config 确实包含此内容,因此您的 PATH 中可能有 macports 或 fink 在我们之前。

关于macos - 在 Mac 上为 Mono 配置 PKG_CONFIG_PATH,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4420063/

相关文章:

macos - 是否可以为付费 Mac 应用程序提供促销代码(无应用内购买)

windows - 为 Postgres 工具设置 Windows PATH

java - java中.txt文件的路径

c# - MonoTouch 中的自定义 UIButton 颜色

c# - 为什么具有默认值枚举参数的泛型类的构造函数无法调用该类的 protected 方法?

postgresql - 错误 : Failure while executing; `/bin/launchctl bootstrap gui/501/Users/josh/Library/LaunchAgents/homebrew.mxcl.postgresql@14.plist` exited with 5

cocoa - NSMenuDelegate 问题

macos - 如何在 macOS 中链接到 GNU readline 库而不是 libedit?

Ant 路径转换

mono - 无法使用 mono 命令提示符为 gtk# 编译 hello.cs