GTK +安装

hal*_*ver 5 linux gtk

我正在使用ubuntu 12.10.我有CODE:阻止IDE.我想使用gtk +,但是当我创建一个项目并构建它时,它说它无法找到gtk.h文件.

我通过写作下载了gtk +,glib,pango,gdk-pixbuf和atk

git clone git://git.gnome.org/gtk+, 
git clone git://git.gnome.org/glib

...
Run Code Online (Sandbox Code Playgroud)

然后我解压缩了所有的库.在这里,每件事都很好.

要安装gtk +我写"./configure --prefix =/opt/gtk"它开始处理,大部分进程都没问题,但随后出现错误

...
checking for some Win32 platform... no
checking whether build environment is sane... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for BASE_DEPENDENCIES... no
configure: error: Package requirements (glib-2.0 >= 2.33.1    atk >= 2.5.3    pango >= 1.30.0    cairo >= 1.10.0    cairo-gobject >= 1.10.0    gdk-pixbuf-2.0 >= 2.26.0) were not met:
No package 'glib-2.0' found
No package 'atk' found
No package 'pango' found
No package 'cairo' found
No package 'cairo-gobject' found
No package 'gdk-pixbuf-2.0' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables BASE_DEPENDENCIES_CFLAGS
and BASE_DEPENDENCIES_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
Run Code Online (Sandbox Code Playgroud)

我试着通过在他们的目录中编写./configure来安装其他库.但它无法提交配置文件.

我设置PKG_CONFIG_PATH但无论如何它都不起作用

我该如何安装?

小智 11

你应该使用:apt-get install libgtk2.0-dev


lib*_*rce 6

你不需要这个git clone步骤.仅当您想要重建GTK +时才需要这样做.

你想要的是Linux发行版的开发包.在您的包中搜索类似的东西libgtk*-dev,并安装它.这将安装您需要的标头和所需的所有依赖项.此外,pkg-config不需要任何提示来查找.pc描述如何针对这些库构建和链接应用程序的文件,因此无需进行配置PKG_CONFIG_PATH.