./configure流程
export PKG_CONFIG_PATH=D:/drawtext/libxml2/lib/pkgconfig:$PKG_CONFIG_PATH
export PKG_CONFIG_PATH=D:/drawtext/freetype/lib/pkgconfig:$PKG_CONFIG_PATH
pacman -S gperf
./configure --prefix=D:/drawtext/fontconfig --enable-libxml2 --disable-docs
出现问题
checking for FREETYPE... no
configure: error: Package requirements (freetype2 >= 21.0.15) were not met:
No package 'freetype2' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables FREETYPE_CFLAGS
and FREETYPE_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
明明export了依赖路径,但是为什么还提示No package 'freetype2' found
。
解决思路:
执行echo $PKG_CONFIG_PATH
,看看PKG_CONFIG_PATH是否设置正确。
发现如果export 多个路径,他们之间会用 :区分 。
我的export PKG_CONFIG_PATH=D:/drawtext/libxml2/lib/pkgconfig:$PKG_CONFIG_PATH
。用的绝对路径,里边带有一个:,这就是问题所在。
改成了export PKG_CONFIG_PATH=/drawtext/freetype/lib/pkgconfig:$PKG_CONFIG_PATH
,问题解决。
这都是什么坑啊!!!!!
下边这个问题与上边的问题相同
checking for LIBXML2... no
configure: error: Package requirements (libxml-2.0 >= 2.6) were not met:
No package 'libxml-2.0' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables LIBXML2_CFLAGS
and LIBXML2_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
最后看一下PKG_CONFIG_PATH,冒号用来分隔不同路径
问题二:
/fc-cache/fc-cache.exe: error while loading shared libraries
解决办法转载自https://blog.csdn.net/w839687571/article/details/103166104/
在fontconfig makefile中搜索 RUN_FC_CACHE_TEST 然后.
RUN_FC_CACHE_TEST = test -z "$(DESTDIR)"
#RUN_FC_CACHE_TEST = false
改为:
#RUN_FC_CACHE_TEST = test -z "$(DESTDIR)"
RUN_FC_CACHE_TEST = false // 这里开启