有关用crosstool-ng编译交叉工具链出现找不到expat的问题的解决办法

来源:互联网 发布:js字符串拼接方法 编辑:程序博客网 时间:2024/05/07 06:11

最近在编一个针对loongson的编译链,用的是crosstool-ng提供的工具,在编译的gdb模块时,出现如下错误:

[ERROR]    configure: error: expat is missing or unusable

[ERROR]    make[2]: *** [configure-gdb] Error 1
[ALL  ]    make[2]: Leaving directory `/home/andy/crosstool-ng/build13/.build/mipsel-ls2f-linux-gnu/build/build-gdb-cross'
[ERROR]    make[1]: *** [all] Error 2
[ALL  ]    make[1]: Leaving directory `/home/andy/crosstool-ng/build13/.build/mipsel-ls2f-linux-gnu/build/build-gdb-cross'
[ERROR]    
[ERROR]    >>
[ERROR]    >>  Error happened in: main[scripts/crosstool-NG.sh]
[ERROR]    >>
[ERROR]    >>  For more info on this error, look at the file: 'build.log'
[ERROR]    >>  There is a list of known issues, some with workarounds, in:
[ERROR]    >>      '/home/andy/crosstool-ng/install/share/doc/ct-ng-1.13.0/B - Known issues.txt'
[ERROR]    

[ERROR]    Build failed in step 'Extracting and patching toolchain components'


一开始以为是没有装expat,sudo apt-get install expat后发现该软件已经装好,到/usr/lib目录下并没有发现libexpat.so文件,到网上查了下也没有相关的信息。因为之前在编译android文件系统的机器上用crosstool-ng编译成功过一个交叉编译链,所以觉得应该是没有安装相关包,所以在本机器上直接将编译android文件系统需要的相关包安装上(详见没博客上得编译android文件系统有关文章),并sudo apt-get install libexpat-dev后再次编译,最后成功编译出需要的工具链。