Mac 上 Mono 的 pkg-config 路径

发布于 2024-09-13 07:13:09 字数 651 浏览 5 评论 0原文

我在 Mac OS X 中安装了 Mono。我按照 Mono 网站上的这些说明进行操作。第一个控制台应用程序之所以有效,是因为它没有使用任何包。但是,当我运行 gmcs hello.cs -pkg:gtk-sharp-2.0 时,它告诉我我没有安装 pkg-config。所以我安装了pkg-config。现在我收到此错误,因为 pkg-config 不知道单声道包路径:

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.

Where is the mono package path and how do I need to add to .bash_profile to make it so that Mono can find the包裹?

I installed mono in Mac OS X. I was following these instructions on the mono website. The first console application worked because it didn't use any packages. However, when I ran gmcs hello.cs -pkg:gtk-sharp-2.0, it told me I didn't have pkg-config installed. So I installed pkg-config. Now I get this error because pkg-config doesn't know the mono package 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.

Where is the mono package path and what do I need to add to .bash_profile to make it so that Mono can find the packages?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

暖心男生 2024-09-20 07:13:09

那么这取决于单声道的位置。只需使用 which mono 从控制台找到它,这将为您提供类似 /opt/local/bin/mono 的内容(如果您确实使用了 macports)。 PKG_CONFIG_PATH 对应于 /opt/local/lib/pkgconfig/。您还可以启动 find /opt/local/ -name "mono.pc" 并查看显示的路径。如果您完全不知道 mono 驻留在哪里(/Developer/Library/Framework 也可能是一个不错的猜测),请使用带有“/”作为路径的 find 命令。

Well it depends on the location of mono. Just locate it from the console using which mono, which will give you something like /opt/local/bin/mono (if you did use macports). The PKG_CONFIG_PATH then corresponds to /opt/local/lib/pkgconfig/. You could also start find /opt/local/ -name "mono.pc" and see which path is revealed. If you have absolutely no clue where mono resides (/Developer/Library/Framework might be a good guess, too) use the find command with "/" as path.

远山浅 2024-09-20 07:13:09

当我在 Mac OS 10.4 上安装 Mono 时,我看到了同样的错误。我尝试了许多不同版本的 Mono。我选择的是 2.4.3.1 版本。为了解决这个问题,我将其添加到我的 ~/.bash_profile 文件中:

# Add Mono's pkgconfig folder to the PKG_CONFIG_PATH variable
export PKG_CONFIG_PATH="/Library/Frameworks/Mono.framework/Versions/2.4.3.1/lib/pkgconfig":$PKG_CONFIG_PATH

打开此文件的一个简单方法是打开一个新的终端窗口,然后粘贴此命令:

open ~/.bash_profile

我很好奇在这些可分发版本的 Mono 发布之前进行了多少测试释放。似乎所有 PowerPC 版本的 Mono 都存在一些重大问题,导致它们无法工作。

When I was installing Mono on Mac OS 10.4, I saw the same error. I tried many different versions of Mono. Version 2.4.3.1 is what I settled on. To fix the problem I added this to my ~/.bash_profile file:

# Add Mono's pkgconfig folder to the PKG_CONFIG_PATH variable
export PKG_CONFIG_PATH="/Library/Frameworks/Mono.framework/Versions/2.4.3.1/lib/pkgconfig":$PKG_CONFIG_PATH

An easy way to open this file is open a new terminal window, then paste this command:

open ~/.bash_profile

I am curious how much testing went into these distributable versions of Mono before they were released. It seems like all the PowerPC versions of Mono have some major problem with them that prevents them from working.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文