当前位置: 首页 > others > 正文

编译GD freetype.h 错误的解决

在编译GD时

./configure –prefix=/usr/local/gd –with-jpeg=/usr/local/jpeg6/ –with-png=/usr/local/lib/ –with-zlib=/usr/local/lib/ –with-freetype=/usr/local/freetype/

make时出现错误:

In file included from gdft.c:57:

/usr/include/freetype2/freetype/freetype.h:20:2: #error “`ft2build.h’ hasn’t been included yet!”

/usr/include/freetype2/freetype/freetype.h:21:2: #error “Please always use macros to include FreeType header files.”

/usr/include/freetype2/freetype/freetype.h:22:2: #error “Example:”

/usr/include/freetype2/freetype/freetype.h:23:2: #error ” #include

/usr/include/freetype2/freetype/freetype.h:24:2: #error ” #include FT_FREETYPE_H”

找到对应的freetype目录

vi freetype/freetype.h

#ifndef FT_FREETYPE_H

#error “`ft2build.h’ hasn’t been included yet!”

#error “Please always use macros to include FreeType header files.”

#error “Example:”

#error ” #include

#error ” #include FT_FREETYPE_H”

#endif

解决方案:

进入gd-2.*.*

vi gdft.c

找到如下:

#include “gdcache.h”

-#include “freetype/freetype.h”

+#include

+#include FT_FREETYPE_H

#include “freetype/ftglyph.h”

重新make 即可

本文固定链接: http://2hei.net/%e7%bc%96%e8%af%91gd-freetypeh-%e9%94%99%e8%af%af%e7%9a%84%e8%a7%a3%e5%86%b3.html | 2hei's site

该日志由 2hei 于2007年11月01日发表在 others 分类下,
原创文章转载请注明: 编译GD freetype.h 错误的解决 | 2hei's site

编译GD freetype.h 错误的解决:目前有1 条留言

  1. 沙发
    elva:

    i have the same error!

    and is there any helpful?

    2007-11-05 下午 11:30