【发布时间】:2014-07-19 19:06:48
【问题描述】:
我在 debian 上。 我做了 sudo apt-get install mono-complete
我正在编译这个程序
user@debian:~$ cat a2.cs
using Gtk;
using System;
class Hello {
static void Main()
{
Application.Init ();
Window window = new Window ("helloworld");
window.Show();
Application.Run ();
}
}
然后当我尝试编译它时,我得到了这个错误
user@debian:~$ mcs a2.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.
user@debian:~$
类似问题的一个答案是尝试 dmcs
user@debian:~$ dmcs a2.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.
user@debian:~$
但是 dmcs 给出了同样的错误
我看到了执行 yum install gtk-sharp2 的建议,但无论我使用什么咒语都说没有可用的包,所以我不确定那个包是什么
user@debian:~$ sudo yum install gtk-sharp-2.0
Setting up Install Process
No package gtk-sharp-2.0 available.
Nothing to do
user@debian:~$
user@debian:~$ sudo yum install gtk-sharp2-devel
Setting up Install Process
No package gtk-sharp2-devel available.
Nothing to do
user@debian:~$
我查看了我的错误https://stackoverflow.com/search?q=cs8027,他们都说这个变量 PKG_CONFIG_PATH 必须指向正确的路径。
目前虽然该变量不存在,但我不知道将其指向什么路径。显然,这是一个包含一些 .pc 文件的 gtk 路径。我不知道那在哪里。
user@debian:/usr$ echo $PKG_CONFIG_PATH
user@debian:/usr$
【问题讨论】:
-
在 debian 中百胜?不,我认为您想使用 apt-get;无论如何,我将此问题标记为重复
-
@knocte 你链接到的问题有关于百胜的答案。 Yum 的尝试(我知道不应该在 debian 中)运行 Yum 只是一个错误,幸运的是它没有做任何事情。我在您的“重复”链接上没有看到任何可以解决我的问题的答案
-
链接的问题有2个答案,一个是关于yum,另一个是关于apt-get
标签: c# linux mono debian pkg-config