如何在Linux下编译Freetype1.x

本文解决在Linux平台编译Freetype1.3.1遇到的错误,并提供详细的修改步骤来确保编译过程顺利进行。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

由于在PHP程序中用了jpgraph,需要TTF支持。需要安装freetype1.x。

编译freetype1.3.1的时候不能编译通过.其错误如下.
ftdump.c:172:1: pasting "." and "glyph_object" does not give a valid preprocessing token
ftdump.c:182:1: pasting "." and "first_instance" does not give a valid preprocessing token
ftdump.c:191:1: pasting "." and "second_instance" does not give a valid preprocessing token
ftdump.c:201:1: pasting "." and "face_object" does not give a valid preprocessing token
ftdump.c:202:1: pasting "." and "glyph_object" does not give a valid preprocessing token
ftdump.c:203:1: pasting "." and "second_instance" does not give a valid preprocessing token
ftdump.c:863:1: pasting "." and "initial_overhead" does not give a valid preprocessing token
ftdump.c:882:1: pasting "." and "face_object" does not give a valid preprocessing token
make[1]: *** [ftdump.o] Error 1
make[1]: Leaving directory `/software/freetype-1.3.1/test'
make: *** [tttest] Error 2

在freetype网站上看了文档 http://freetype.sourceforge.net/freetype1/docs/faq/freetype1.txt,应该是测试程序在Linux平台不能编译吧。

修改Makefile.in:
1. 去掉all: ttlib tttest ttpo中的tttest
2. 删除
install:
        cd $(FTLIBDIR); $(MAKE) -f $(MAKEFILE) uninstall
        cd $(FTTESTDIR); $(MAKE) -f $(MAKEFILE) uninstall
        cd $(FTPODIR); $(MAKE) uninstall
中的 cd $(FTTESTDIR); $(MAKE) -f $(MAKEFILE) uninstall


# ./configure --prefix=/Data/apps/freetype1
# make
# make install

  最后提醒一下,如果以前在PHP中编译了GD,一定要加入--with-freetype重新编译GD,否则在PHP上是不能获得Freetype支持的

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

多鱼的夏天

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值