编译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 即可