免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 37740 | 回复: 10
打印 上一主题 下一主题

已解决: libxml2 死活安装不上, 求解 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-10-26 15:48 |只看该作者 |倒序浏览
本帖最后由 hidinga 于 2011-10-26 18:12 编辑

操作系统: CentOS release 5.7 (Final)

内核:2.6.18-164.11.1.el5 x86_64 GNU/Linux


libxml2-2.7.8.tar.gz 安装不上, 过程如下:

tar zxvf libxml2-2.7.8.tar.gz
cd libxml2-2.7.8
./configure

  1. configure: creating ./config.status
  2. config.status: creating libxml2.spec
  3. config.status: creating Makefile
  4. config.status: creating include/Makefile
  5. config.status: creating include/libxml/Makefile
  6. config.status: creating doc/Makefile
  7. config.status: creating doc/examples/Makefile
  8. config.status: creating doc/devhelp/Makefile
  9. config.status: creating example/Makefile
  10. config.status: creating python/Makefile
  11. config.status: creating python/tests/Makefile
  12. config.status: creating xstc/Makefile
  13. config.status: creating include/libxml/xmlversion.h
  14. config.status: creating xml2-config
  15. config.status: creating libxml-2.0.pc
  16. config.status: creating libxml-2.0-uninstalled.pc
  17. config.status: creating python/setup.py
  18. config.status: creating config.h
  19. config.status: config.h is unchanged
  20. config.status: executing depfiles commands
  21. config.status: executing libtool commands
  22. /bin/rm: cannot remove `libtoolT': No such file or directory
  23. Done configuring
复制代码
make
  1. libtool: link: ar cru .libs/testdso.a  testdso.o
  2. libtool: link: ranlib .libs/testdso.a
  3. libtool: link: ( cd ".libs" && rm -f "testdso.la" && ln -s "../testdso.la" "testdso.la" )
  4. gcc -DHAVE_CONFIG_H -I. -I./include -I./include  -D_REENTRANT      -fPIC -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -MT xmllint.o -MD -MP -MF .deps/xmllint.Tpo -c -o xmllint.o xmllint.c
  5. cc1: warning: -Wuninitialized is not supported without -O
  6. mv -f .deps/xmllint.Tpo .deps/xmllint.Po
  7. /bin/sh ./libtool --tag=CC   --mode=link gcc  -fPIC -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls   -o xmllint xmllint.o ./libxml2.la  -lz  -lm
  8. libtool: link: gcc -fPIC -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -o .libs/xmllint xmllint.o  ./.libs/libxml2.so -ldl -lz -lm -Wl,-rpath -Wl,/usr/local/lib
  9. ./.libs/libxml2.so: undefined reference to `gzopen64'
  10. collect2: ld returned 1 exit status
  11. make[2]: *** [xmllint] Error 1
  12. make[2]: Leaving directory `/home/ping.bao/libxml2-2.7.8'
  13. make[1]: *** [all-recursive] Error 1
  14. make[1]: Leaving directory `/home/ping.bao/libxml2-2.7.8'
  15. make: *** [all] Error 2
复制代码
附 :

ldconfig -v|ldconfig -v|grep libz

        libz.so.1 -> libz.so.1.2.5
        libz.so.1 -> libz.so.1.2.3
        libz.so.1 -> libz.so.1.2.5
        libz.so.1 -> libz.so.1.2.3

在另外一台Ubuntu 的机器上就能装得很顺利 。。。

论坛徽章:
1
天秤座
日期:2013-10-23 13:20:42
2 [报告]
发表于 2011-10-26 15:57 |只看该作者
可否考虑使用yum安装编译好的libxml2-2.7.8?

ps:系统有的
[root@machine1 ~]# rpm -aq|grep -i libxml
libxml2-2.6.26-2.1.2.8
能否满足你的要求?

论坛徽章:
0
3 [报告]
发表于 2011-10-26 16:03 |只看该作者
本帖最后由 hidinga 于 2011-10-26 16:11 编辑

回复 2# jerryjzm


    谢谢 jerryjzm 同学, 我要要安装 xmlstarlet 这个小工具来处理 XML,要求 libxml2-2.6.27 以上才行 ... 所以才升级,但是升级任何版本都不好用

    我下载了 rpm 包的 libxml2-2.7.8 ,安装的时候还提示我要升级 glibc ,貌似是更加麻烦 ...

论坛徽章:
0
4 [报告]
发表于 2011-10-26 16:11 |只看该作者
回复 1# hidinga


    /bin/rm: cannot remove `libtoolT': No such file or directory  

    去搜搜  ./configure 没过关

论坛徽章:
0
5 [报告]
发表于 2011-10-26 17:50 |只看该作者
回复 4# taojie2000


    我在UBUNTU 上面也没有过关,所以个人认为是代码质量问题,作者应该是想删除一个临时的文件,而没删成功

论坛徽章:
0
6 [报告]
发表于 2011-10-26 18:14 |只看该作者
本帖最后由 hidinga 于 2011-10-26 18:16 编辑

安装了两个版本的 zlib,1.2.3 与 1.2.5 , 删除 1.2.3 相关 so 文件不能解决,删除 1.2.5 相关文件,OK了

删除  /lib/libz.so.1.2.5
删除  /lib/libz.so
删除  /usr/lib/libz.so.1
删除  /usr/lib/libz.so.1.2.5

[root@jsvest xmlstarlet-1.2.1]# ldconfig -v|grep libz

        libz.so.1 -> libz.so.1.2.3
        libz.so.1 -> libz.so.1.2.3

[root@jsvest xmlstarlet-1.2.1]# xml ls|xml ed -d "//@m"
<?xml version="1.0"?>
<dir>
  <d p="rwxr-xr-x" a="20111026T025944Z" s="4096" n="m4"/>
  <f p="rw-r--r--" a="20111026T101154Z" s="24" n="version.h"/>
  <f p="rw-r--r--" a="20111026T025944Z" s="4825" n="NEWS"/>
  <f p="rwxr-xr-x" a="20111026T101147Z" s="44504" n="config.guess"/>
  <f p="rw-r--r--" a="20111026T025944Z" s="7832" n="INSTALL"/>
  <f p="rw-r--r--" a="20111026T025944Z" s="1093" n="COPYING"/>
  <f p="rw-r--r--" a="20111026T025944Z" s="4577" n="configure.ac"/>
  <f p="rwxr-xr-x" a="20111026T101154Z" s="122758" n="xml"/>
  <f p="rw-r--r--" a="20111026T025944Z" s="246" n="README"/>
  <f p="rw-r--r--" a="20111026T101151Z" s="3007" n="config.h"/>
  <f p="rw-r--r--" a="20111026T101148Z" s="1029" n="xmlstarlet.spec.in"/>
  <d p="rwxr-xr-x" a="20111026T025944Z" s="4096" n="solaris"/>
  <f p="rw-r--r--" a="20111026T025944Z" s="1763" n="Makefile.am"/>
  <d p="rwxr-xr-x" a="20111026T025944Z" s="4096" n="tests"/>
  <f p="rw-r--r--" a="20111026T101154Z" s="34756" n="Makefile"/>
  <f p="rw-r--r--" a="20111026T025949Z" s="22739" n="config.log"/>
  <f p="rwxr-xr-x" a="20111026T101147Z" s="18615" n="depcomp"/>
  <f p="rwxr-xr-x" a="20111026T101147Z" s="11419" n="missing"/>
  <d p="rwxr-xr-x" a="20111026T101154Z" s="4096" n="doc"/>
  <d p="rwxr-xr-x" a="20111026T101154Z" s="4096" n="src"/>
  <f p="rwxr-xr-x" a="20111026T101148Z" s="209560" n="configure"/>
  <f p="rw-r--r--" a="20111026T101148Z" s="2698" n="config.h.in"/>
  <d p="rwxr-xr-x" a="20111026T025944Z" s="4096" n="examples"/>
  <f p="rwxr-xr-x" a="20111026T025944Z" s="13663" n="install-sh"/>
  <f p="rwxr-xr-x" a="20111026T101148Z" s="34582" n="config.status"/>
  <f p="rw-r--r--" a="20111026T025944Z" s="52" n="AUTHORS"/>
  <f p="rw-r--r--" a="20111026T101148Z" s="35399" n="Makefile.in"/>
  <f p="rwxr-xr-x" a="20111026T101147Z" s="35206" n="config.sub"/>
  <f p="rw-r--r--" a="20111026T025944Z" s="1" n="ChangeLog"/>
  <f p="rw-r--r--" a="20111026T025944Z" s="199" n="TODO"/>
  <f p="rw-r--r--" a="20111026T025952Z" s="23" n="stamp-h1"/>
  <f p="rw-r--r--" a="20111026T101148Z" s="986" n="xmlstarlet.spec"/>
  <f p="rw-r--r--" a="20111026T025944Z" s="1093" n="Copyright"/>
  <f p="rwxr-xr-x" a="20111026T025944Z" s="3769" n="compile"/>
  <f p="rw-r--r--" a="20111026T025944Z" s="38584" n="aclocal.m4"/>
</dir>

论坛徽章:
1
天秤座
日期:2013-10-23 13:20:42
7 [报告]
发表于 2011-10-26 22:05 |只看该作者
不错,顺利解决,顺利结贴,有始有终!

论坛徽章:
0
8 [报告]
发表于 2011-10-27 18:14 |只看该作者
我今天下午也遇到这个问题了,找了一下午,有几个人遇到这个问题了,

http://hi.baidu.com/guangchun/bl ... 4bad3367096e19.html
这个方法没能行,你的方法也没能行,

我的方法是http://hi.baidu.com/haofefe/blog ... 4f7fccb48f31d6.html

在configure 加上 --without-zlib 可以编译通过

论坛徽章:
0
9 [报告]
发表于 2012-01-17 14:29 |只看该作者
本帖最后由 flyer_2001 于 2012-01-17 14:29 编辑

mingw windows 环境下解决方法:
configure文件中行16341
    "libtool":C) 改成    "libtool空格":C)
问题解决

论坛徽章:
1
卯兔
日期:2013-12-09 08:47:37
10 [报告]
发表于 2012-08-01 00:33 |只看该作者
是,今天做的时候也出现这样的问题,但是方法无效,引用了without之后,貌似可以编译通过,但是目前还没发现问题,不知道对后面有没有影响回复 8# bingdong700


   
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP