GTK+的编译还真麻烦

GTK+的编译还真麻烦

搞了一天了,差不多装了7-8个软件,下载、解压、配置、编译、安装、设定ld。装这个说需要那个,装那个又说需要地三个。
反反服务,还有最后遇到问题,pangocairo还是cairopango没有,还是什么render没有,这两个都装了,但是没有名字在一起的包。
最后在官方首页看到一句话:GTK+ is a large package that is dependent on a number of other tools and libraries. It is recommended that you use precompiled binary packages for your system if possible
GTK+是一个巨大的包,它以来很多其他的工具和库。建议尽可能的使用为你的系统编译好的二进制的包。
好歹最后发现了问题所在,重新编译了cairo,不使用默认配置参数,启用了几个选项。终于安装好了。


这里有个转载的安装手记http://www.phpx.com/happy/archiver/tid-125828.html

GLIB 安装手记(ZT)

第一个GLIB
第二个ATK
第三个CAIRO
第四个PANGO
(安装指令统一为:./configure --prefix=/usr && make && make install)
第五个GTK

安装GTK的时候参数参考[url]http://www.gtk.org[/url] (./configure --prefix=/opt/gtk)

安装完GTK之后记得将gtk+-2.0.pc 复制到/usr/lib/pkgconfig下

CAIRO的下载
[url]http://cairographics.org/snapshots/LATEST-cairo-0.9.2[/url]
GTK相关安装软件下载
[url]http://www.gtk.org[/url]

PANGO 的安装路径:
默认安装在/usr/local下对pango来说不行,
这样比较全面./configure --prefix=/usr --libdir=/usr/lib --sysconfdir=/etc

注意:编译第一个例子时
gcc base.c -o base `pkg-config --cflags --libs gtk+-2.0`
注意上面编译命令中使用的单引号类型是很重要的。(译者注:这里使用了“命令替换”。命令替换(command substitution)使得可以捕获一个命令的输出而在另一个命令中替换它。这个单引号不是回车键左边的那个,而是ESC键下面的那个。)

ChangeLog :
05/02/06 :编译dosbox make时出现找不到头文件错误,类似的错误曾经碰到过.记录。:)
LD_LIBRARY_PATH的作用。
从源码编译安装东东,不是很容易,想想在使用lfs之前,源码编译安装软件从来没
成功过,甚至出现错误都无从下手,只能放弃 :(
经过lfs的洗礼,总算对源码编译安装有了一点认识,可惜当初没有把这些经验写下来 :(
不过现在开始写也不迟 :) 将编译中遇到的问题及解决的方法记下来,积累经验,
也可以让来往的newbie对源码安装软件了解一些,多一些成功机率,毕竟从源码包编译
东东还是有一定好处的 ^_^
先说一下源码编译的基本方法及源码编译过程中几个重要的文件,以及重要变量
PKG_CONFIG_PATH 的设定,经常在论坛看到有人源码编译失败,都是这个东东搞的鬼 ^_^


这里是官方说明:http://library.gnome.org/devel/gtk-faq/stable/c192.html#FAQ-COMPILE

How to find, configure, install, and troubleshoot GTK+

What do I need to compile GTK+? [GTK 2.x]

GTK+ is a large package that is dependent on a number of other tools and libraries. It is recommended that you use precompiled binary packages for your system if possible

To compile GTK+ from source you need a C compiler (gcc) and the X Window System and associated development libraries and packages on your system.

You will also need to have installed the tools and libraries that GTK+ depends upon. These are listed below in the order in which they need to be installed:

  • pkg-config (pkg-config Site )
  • GNU make (GNU make Site )
  • JPEG, PNG and TIFF image libraries (GTK+ Site )
  • FreeType (FreeType Site )
  • fontconfig (fontconfig Site )
  • GNU libiconv library (if your system doesn't have iconv()) (GNU libiconv Site )
  • GNU gettext (if your system doesn't have gettext()) (GTK+ Site )
  • GLib (GTK+ Site )
  • Pango (GTK+ Site )
  • ATK (GTK+ Site )
  • GTK+ (GTK+ Site )

最后在这里发现可能是问题所在http://www.gtkforums.com/about3760.html:
The root of the problem seems to be here (from pango configure output):

checking for CAIRO... yes
checking which cairo font backends could be used... none
configure: Disabling cairo support

Therefor pangocairo.so wasn't built, and pangocairo*.h weren't installed...
If I figure out why pango is refusing to use cairo's freetype backend I'll let you know...

BTW, I'm on CentOS 5.3, trying to get compiz-fusion working, but it needs latest pygtk2, which needs latest gtk++...




你可能感兴趣的:(GTK+的编译还真麻烦)