Mac 上 Mono 的 pkg-config 路径
我在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
那么这取决于单声道的位置。只需使用
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 startfind /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.当我在 Mac OS 10.4 上安装 Mono 时,我看到了同样的错误。我尝试了许多不同版本的 Mono。我选择的是 2.4.3.1 版本。为了解决这个问题,我将其添加到我的 ~/.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:
An easy way to open this file is open a new terminal window, then paste this command:
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.