SAX1 support in libxml2 is required. enable it or use expat instead.

环境:linux,fontconfig-2.13.1.tar.gz,expat-2.2.7.tar.bz2,freetype-2.7.tar.gz,libuuid-1.0.3.tar.gz,libxml2-2.7.8.tar.gz

问题:linux编译fontconfig时报错:

*** SAX1 support in libxml2 is required. enable it or use expat instead.

报错指令:

./configure FREETYPE_LIBS=-L/home/test/code/freetype-2.7/build FREETYPE_CFLAGS=-I/home/test/code/freetype-2.7/include UUID_LIBS=-L/home/test/code/thirdparty/libuuid UUID_CFLAGS=-I/home/test/code/thirdparty/libuuid/include --with-expat=/home/test/code/thirdparty/expat --with-expat-lib=-L/home/test/code/thirdparty/expat/lib --with-expat-includes=-I/home/test/code/thirdparty/expat/include --enable-libxml2 LIBXML2_CFLAGS=-I/home/test/code/thirdparty/libxml2/include LIBXML2_LIBS=-L/home/test/code/thirdparty/libxml2/lib

报错分析:查看fontconfig的configure文件,发现该错误是#include <libxml/xmlversion.h>附近,于是尝试重新执行LIBXML2_CFLAGS,改为

./configure FREETYPE_LIBS=-L/home/test/code/freetype-2.7/build FREETYPE_CFLAGS=-I/home/test/code/freetype-2.7/include UUID_LIBS=-L/home/test/code/thirdparty/libuuid UUID_CFLAGS=-I/home/test/code/thirdparty/libuuid/include --with-expat=/home/test/code/thirdparty/expat --with-expat-lib=-L/home/test/code/thirdparty/expat/lib --with-expat-includes=-I/home/test/code/thirdparty/expat/include --enable-libxml2 LIBXML2_CFLAGS=-I/home/test/code/thirdparty/libxml2/include/libxml2 LIBXML2_LIBS=-L/home/test/code/thirdparty/libxml2/lib

问题解决。

posted @ 2023-12-08 10:20  飞飞龙  阅读(104)  评论(0)    收藏  举报