雷达智富

首页 > 内容 > 程序笔记 > 正文

程序笔记

Linux下编译libxml2的源码报错:you must specify a host type if you use `--no-verify'

2024-08-11 29

问题描述

在Ubuntu Linux下编译libxml2源码时,执行./configure时,报如下错误:

ltconfig: you must specify a host type if you use --no-verify
Try ltconfig --help for more information.
configure: error: libtool configure failed

其实真正有用的是下面的错误信息:

checking host system type... Invalid configuration x86_64-unknown-linux-gnu: machine x86_64-unknown not recognized
checking build system type... Invalid configuration x86_64-unknown-linux-gnu: machine x86_64-unknown not recognized

大意是configure认不出系统的类型, 然后出现下面的 you must specify a host type.

解决方法

用 /usr/share/libtool/config.guess 覆盖 config.guess
用 /usr/share/libtool/config.sub 覆盖 config.sub

这样configure就可以猜出系统的类型了, 然后编译正常了。
部分系统版本中可能/usr/share/libtool/目录下没有config.guess和config.sub文件,可以通过find命令查找一下:

find /usr/share/ -name config.guess

比如我的系统找出来的目录是在/usr/share/misc/。

更新于:1个月前
赞一波!3

文章评论

全部评论