---
title: "facebook open platform的libfbml库在redhat下编译问题汇总"
author: "freeway2000"
date: "2008-10-15T15:38:06Z"
tags: []
categories: ["操作系统"]
slug: "facebook-open-platform-libfbml-redhat"
draft: false
lastmod: "2008-10-15T15:38:06Z"
id: 253188
url: "https://freeway2000.iteye.com/blog/253188"
---

本文着重解决在编译libfbml中遇到的一些具体问题，所以具体的安装步骤一概省略。

我使用的linux环境是：  
Red Hat Enterprise Linux AS release 4 (Nahant Update 4)  
Linux version 2.6.9-42.0.10.ELsmp (brewbuilder@ls20-bc1-14.build.redhat.com) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-3)) #1 SMP Fri Feb 16 17:13:42 EST 2007  
x86\_64 GNU/Linux

之前需要安装: xorg-x11-devel、freetype、freetype-devel、fontconfig-devel、php\_devel、libjpeg、zip、unzip、libjpeg

==========================================================================================================

状况：  
checking for gcc option to accept ANSI C... none needed  
checking for a BSD-compatible install... /usr/bin/install -c  
checking for special C compiler options needed for large files... no  
checking for \_FILE\_OFFSET\_BITS value needed for large files... no  
checking for pkg-config... /usr/bin/pkg-config  
configure: error: \*\** pkg-config too old; version 0.16 or better required.  
Running "./configure" within the "glib-2.14.6" subdirectory failed with error code 256.  Aborting script..  
.  
解决：  
./configure --prefix=/usr  
\==========================================================================================================  
状况：  
checking for pkg-config... /usr/bin/pkg-config  
checking for GLIB - version &gt;= 2.5.7...  
\*\** 'pkg-config --modversion glib-2.0' returned 2.14.6, but GLIB (2.4.7)  
\*\** was found! If pkg-config was correct, then it is best  
\*\** to remove the old version of GLib. You may also be able to fix the error  
\*\** by modifying your LD\_LIBRARY\_PATH enviroment variable, or by editing  
\*\** /etc/ld.so.conf. Make sure you have run ldconfig if that is  
\*\** required on your system.  
\*\** If pkg-config was wrong, set the environment variable PKG\_CONFIG\_PATH  
\*\** to point to the correct configuration files  
no  
configure: error:  
\*\** GLIB 2.5.7 or better is required. The latest version of  
\*\** GLIB is always available from ftp://ftp.gtk.org/. If GLIB is installed  
\*\** but not in the same location as pkg-config add the location of the file  
\*\** glib-2.0.pc to the environment variable PKG\_CONFIG\_PATH.  
Running "./configure" within the "atk-1.9.1" subdirectory failed with error code 256.  Aborting script...

解决：  
ll /usr/lib/libglib*

lrwxrwxrwx  1 root root      21 Feb 13  2007 /usr/lib/libglib-1.2.so.0 -&gt; libglib-1.2.so.0.0.10  
\-rwxr-xr-x  1 root root  142948 Aug  9  2004 /usr/lib/libglib-1.2.so.0.0.10  
\-rwxr-xr-x  1 root root     810 Oct 14 14:49 /usr/lib/libglib-2.0.la  
lrwxrwxrwx  1 root root      23 Oct 14 14:49 /usr/lib/libglib-2.0.so -&gt; libglib-2.0.so.0.1400.6  
lrwxrwxrwx  1 root root      23 Oct 14 14:49 /usr/lib/libglib-2.0.so.0 -&gt; libglib-2.0.so.0.1400.6  
\-rwxr-xr-x  1 root root 2604816 Oct 14 14:49 /usr/lib/libglib-2.0.so.0.1400.6

确认/usr/lib/libglib-2.0.so 是否指向了 libglib-2.0.so.0.1400.6  
否则需要  
cd /usr/lib/  
rm libglib-2.0.so  
ln -s libglib-2.0.so.0.1400.6 libglib-2.0.so

==========================================================================================================  
状况：  
/usr/local/lib/libcairo.so: undefined reference to \`FT\_GlyphSlot\_Embolden'  
collect2: ld returned 1 exit status  
make\[2]: \*\** \[cairosimple] Error 1  
make\[2]: Leaving directory \`/opt/huwei/fbopen/libfbml-1.2.0/dependencies/pango-1.18.4/examples'  
make\[1]: \*\** \[all-recursive] Error 1  
make\[1]: Leaving directory \`/opt/huwei/fbopen/libfbml-1.2.0/dependencies/pango-1.18.4'  
make: \*\** \[all] Error 2  
Running "make" within the "pango-1.18.4" subdirectory failed with error code 512.  Aborting script...

解决：  
将libXft的安装顺序放在pango的前面

==========================================================================================================  
状况：  
checking for jpeg\_destroy\_decompress in -ljpeg... no  
configure: WARNING: \*\** JPEG loader will not be built (JPEG library not found) \*\**  
configure: error:  
\*\** Checks for JPEG loader failed. You can build without it by passing  
\*\** --without-libjpeg to configure but some programs using GTK+ may  
\*\** not work properly  
Running "./configure" within the "gtk+-2.10.13" subdirectory failed with error code 256.  Aborting script...

解决：  
./configure --without-libjpeg 或者安装libjpeg  
\==========================================================================================================  
状况：  
编译gtk时出现  
checking for x86 platform... no  
checking for X... no  
configure: error: X development libraries not found

解决：  
./configure --x-includes=/usr/X11R6/includes --x-libraries=/usr/X11R6/lib64 --without-libjpeg

==========================================================================================================  
状况：  
编译gtk时出现  
checking for X... libraries /usr/X11R6/lib, headers /usr/X11R6/includes  
checking for dnet\_ntoa in -ldnet... no  
checking for dnet\_ntoa in -ldnet\_stub... no  
checking for gethostbyname... yes  
checking for connect... yes  
checking for remove... yes  
checking for shmat... yes  
checking for IceConnectionNumber in -lICE... no  
checking for XOpenDisplay... no  
configure: error: \*\** libX11 not found. Check 'config.log' for more details.

解决：  
说明需要安装xorg-x11-devel，如果无法安装请先安装几个依赖的包freetype、freetype-devel、fontconfig-devel

==========================================================================================================  
状况：  
编译libXft时遇到  
checking for XRenderFindStandardFormat... no  
configure: error: libXrender not found or too old.

解决：  
再编译安装一遍xrender-0.8.3  
\===========================================================================================================  
状况：  
../../dist/lib/libgkconcvs\_s.a(nsCanvasRenderingContext2D.o)(.text+0x149d): In function

\`nsCanvasRenderingContext2D::SetDimensions(int, int)':  
: undefined reference to \`XCreatePixmap'  
collect2: ld returned 1 exit status  
gmake\[3]: \*\** \[libgklayout.so] Error 1  
gmake\[3]: Leaving directory \`/usr/home/yunfeng/facebook/facebook/fb-open-platform/libfbml-

1.2.0/dependencies/mozilla/layout/build'  
gmake\[2]: \*\** \[libs] Error 2  
gmake\[2]: Leaving directory \`/usr/home/yunfeng/facebook/facebook/fb-open-platform/libfbml-

1.2.0/dependencies/mozilla/layout'  
gmake\[1]: \*\** \[tier\_9] Error 2  
gmake\[1]: Leaving directory \`/usr/home/yunfeng/facebook/facebook/fb-open-platform/libfbml-1.2.0/dependencies/mozilla'  
make: \*\** \[default] Error 2

解决：  
修改dependencies/mozilla/layout/build/Makefile.in  
查找  
ifdef MOZ\_ENABLE\_GTK2  
EXTRA\_DSO\_LDOPTS += $(MOZ\_GTK2\_LIBS) \\  
            $(NULL)

改成  
ifdef MOZ\_ENABLE\_GTK2  
EXTRA\_DSO\_LDOPTS += $(MOZ\_GTK2\_LIBS) \\  
\-L/usr/X11R6/lib -lX11 -lXrender \\  
        $(NULL)

这个错误一般发生在firefox编译的时候，我一般都手动解压缩firefox软件，然后修改Makefile.in，然后在build-all.py中屏蔽解压缩

firefox的语句就行

===========================================================================================================  
如果是x86\_64系统编译firefox时发生如下类似错误时

/usr/bin/ld: skipping incompatible /usr/X11R6/lib/libX11.so when searching for -lX11  
/usr/bin/ld: cannot find -lX11

需要加入如下参数：

./configure --enable-application=browser --enable-system-cairo --x-libraries=/usr/X11R6/lib64  
如果还不行，执行 ldconfig -p | grep libX11 进行分析，看文件是否存在如不存在说明需要安装xorg\_x11\_devel包  
\===========================================================================================================

状况:  
编译fbml，如果是64位机器会出现  
make\[1]: \*\** No rule to make target \`src/lib/os\_Linux\_x86.o'.  Stop.  
make: \*\** \[src/lib/os\_Linux\_x86.o] Error 2  
Failed to make libfbml.... Aborting  
解决：  
修改build-all.py  
找到  
    system("rm -f src/lib/" + filename) # force the removal of previously set up soft links  
    createSoftLink(dependenciesdir + sep + mozilla, filename, "src" + sep + "lib", ".." + sep + "..")

修改成：  
    system("rm -f src/lib/" + filename) # force the removal of previously set up soft links  
    if filename=="os\_Linux\_x86\_64.o": system("rm -f src/lib/os\_Linux\_x86.o")  
    createSoftLink(dependenciesdir + sep + mozilla, filename, "src" + sep + "lib", ".." + sep + "..")

找到  
    command = "ln -s " + commonparentdir + sep + match + " " + destdir + sep + filename  
    system(command)  
修改成  
    command = "ln -s " + commonparentdir + sep + match + " " + destdir + sep + filename  
    if filename == "os\_Linux\_x86\_64.o":  
                command = "ln -s " + commonparentdir + sep + match + " " + destdir + sep + "os\_Linux\_x86.o"  
                system(command)  
    system(command)  
\===========================================================================================================  
状况：  
sh: phpize: command not found  
Running "phpize" within the "ext" subdirectory failed with error code 32512.  Aborting script..  
解决：

安装php\_devel

=============================

其他安装帮助  
http://forum.developers.facebook.com/viewtopic.php?id=16511  
http://code.google.com/p/facebook-install/wiki/HowToInstallFBMLInUbuntu8  
http://blog.5ilinux.com/cgi-bin/mt-search.cgi?IncludeBlogs=1&search=%E4%B8%8B%E8%BD%BD  
http://fyp832008.blog.163.com/blog/static/914394162008914102158448/