免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2881 | 回复: 3
打印 上一主题 下一主题

编译gd-1.8.1.tar.gz的过程中出现下列错误,要怎么解决? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-06-14 13:19 |只看该作者 |倒序浏览
因为要装GD库,从http://www.boutell.com/gd/http/gd-1.8.1.tar.gz 下载下来了,按教程安装
教程地址http://www.cndw.com/tech/server/2006031820369.asp
编译gd-1.8.1.tar.gz的过程中出现下列错误,要怎么解决?

[root@bbs gd-1.8.3]# rpm -qa | grep xpm
[root@bbs gd-1.8.3]# make
gcc -I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11 -O  -c -o gd.o gd.c
make: gcc: Command not found
make: *** [gd.o] Error 127
[root@bbs gd-1.8.3]# make install
gcc -I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11 -O  -c -o gd.o gd.c
make: gcc: Command not found
make: *** [gd.o] Error 127


Makefile文件内容如下:
#Depending on your system, you will need to modify this makefile.

#If you do not have gcc, change the setting for COMPILER, but you must
#use an ANSI standard C compiler (NOT the old SunOS 4.1.3 cc
#compiler; get gcc if you are still using it).
COMPILER=gcc

#If the ar command fails on your system, consult the ar manpage
#for your system.
AR=ar

#If you don't have FreeType, libjpeg and/or Xpm installed, including the
#header files, uncomment this (default).
CFLAGS=-O
#If you do have FreeType, libjpeg and/or Xpm fully installed, uncomment a
#variation of this and comment out the line above. See also LIBS below.
#CFLAGS=-O  -DHAVE_JPEG -DHAVE_LIBTTF

#If you don't have FreeType and/or Xpm fully installed, uncomment this
#(default).

#PLEASE NOTE: YOU MAY HAVE TO JUGGLE THE ORDER OF THE LIBRARIES.
#Some systems are very picky about link order. They don't all agree
#on the right order, either.

LIBS=-lm -lgd -lpng -lz

#If you do have FreeType, JPEG and/or Xpm fully installed, uncomment a
#variation of this and comment out the line above. Note that
#Xpm requires X11. See also CFLAGS above.

#PLEASE NOTE: YOU MAY HAVE TO JUGGLE THE ORDER OF THE LIBRARIES.
#Some systems are very picky about link order. They don't all agree
#on the right order, either.

#LIBS=-lm -lgd -lpng -lz -ljpeg -lttf

#Typical install locations for freetype, zlib, xpm, libjpeg and libpng header files.
#If yours are somewhere else, change this.
#-I. is important to ensure that the version of gd you are installing
#is used, and not an older release in your directory tree somewhere.

INCLUDEDIRS=-I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11

#Typical install locations for freetype, zlib, xpm and libpng libraries.
#If yours are somewhere else, other than a standard location
#such as /lib or /usr/lib, then change this. Be sure to keep
#-L. as this allows the gd library itself to be found.
#Put -L. first so that old versions of the gd library elsewhere
#on your system can't cause conflicts while building a new one.
LIBDIRS=-L. -L/usr/local/lib -L/usr/lib/X11 -L/usr/X11R6/lib

#Location where libgd.a should be installed by "make install".
INSTALL_LIB=/usr/local/lib

#Location where .h files should be installed by "make install".
INSTALL_INCLUDE=/usr/local/include

#Location where useful non-test programs should be installed by "make install".
INSTALL_BIN=/usr/local/bin

#
#
# Changes should not be required below here.
#
#

VERSION=1.8.1

CC=$(COMPILER) $(INCLUDEDIRS)
LINK=$(CC) $(LIBDIRS) $(LIBS)

PROGRAMS=$(BIN_PROGRAMS) $(TEST_PROGRAMS)

BIN_PROGRAMS=pngtogd pngtogd2 gdtopng gd2topng gd2copypal gdparttopng webpng
TEST_PROGRAMS=gdtest gddemo gd2time gdtestttf

all: libgd.a $(PROGRAMS)

install: libgd.a $(BIN_PROGRAMS)
    sh ./install-item 644 libgd.a $(INSTALL_LIB)/libgd.a
    sh ./install-item 755 pngtogd $(INSTALL_BIN)/pngtogd
    sh ./install-item 755 pngtogd2 $(INSTALL_BIN)/pngtogd2
    sh ./install-item 755 gdtopng $(INSTALL_BIN)/gdtopng
    sh ./install-item 755 gd2topng $(INSTALL_BIN)/gd2topng
    sh ./install-item 755 gd2copypal $(INSTALL_BIN)/gd2copypal
    sh ./install-item 755 gdparttopng $(INSTALL_BIN)/gdparttopng
    sh ./install-item 755 webpng $(INSTALL_BIN)/webpng
    sh ./install-item 755 bdftogd $(INSTALL_BIN)/bdftogd
    sh ./install-item 644 gd.h $(INSTALL_INCLUDE)/gd.h
    sh ./install-item 644 gdcache.h $(INSTALL_INCLUDE)/gdcache.h
    sh ./install-item 644 gd_io.h $(INSTALL_INCLUDE)/gd_io.h
    sh ./install-item 644 gdfontg.h $(INSTALL_INCLUDE)/gdfontg.h
    sh ./install-item 644 gdfontl.h $(INSTALL_INCLUDE)/gdfontl.h
    sh ./install-item 644 gdfontmb.h $(INSTALL_INCLUDE)/gdfontmb.h
    sh ./install-item 644 gdfonts.h $(INSTALL_INCLUDE)/gdfonts.h
    sh ./install-item 644 gdfontt.h $(INSTALL_INCLUDE)/gdfontt.h

gddemo: gddemo.o libgd.a
    $(CC) gddemo.o -o gddemo    $(LIBDIRS) $(LIBS)

pngtogd: pngtogd.o libgd.a
    $(CC) pngtogd.o -o pngtogd    $(LIBDIRS) $(LIBS)

webpng: webpng.o libgd.a
    $(CC) webpng.o -o webpng    $(LIBDIRS) $(LIBS)

pngtogd2: pngtogd2.o libgd.a
    $(CC) pngtogd2.o -o pngtogd2    $(LIBDIRS) $(LIBS)

gdtopng: gdtopng.o libgd.a
    $(CC) gdtopng.o -o gdtopng    $(LIBDIRS) $(LIBS)

gd2topng: gd2topng.o libgd.a
    $(CC) gd2topng.o -o gd2topng    $(LIBDIRS) $(LIBS)

gd2copypal: gd2copypal.o libgd.a
    $(CC) gd2copypal.o -o gd2copypal    $(LIBDIRS) $(LIBS)

gdparttopng: gdparttopng.o libgd.a
    $(CC) gdparttopng.o -o gdparttopng    $(LIBDIRS) $(LIBS)

gdtest: gdtest.o libgd.a
    $(CC) gdtest.o -o gdtest    $(LIBDIRS) $(LIBS)

gd2time: gd2time.o libgd.a
    $(CC) gd2time.o -o gd2time    $(LIBDIRS) $(LIBS)

gdtestttf: gdtestttf.o libgd.a
    $(CC) gdtestttf.o -o gdtestttf    $(LIBDIRS) $(LIBS)

libgd.a: gd.o gd_gd.o gd_gd2.o gd_io.o gd_io_dp.o gd_io_file.o gd_ss.o \
    gd_io_ss.o gd_png.o gd_jpeg.o gdxpm.o gdfontt.o gdfonts.o gdfontmb.o gdfontl.o \
    gdfontg.o gdtables.o gdttf.o gdcache.o gdkanji.o  wbmp.o gd_wbmp.o \
    gd.h gdfontt.h gdfonts.h gdfontmb.h gdfontl.h gdfontg.h
    rm -f libgd.a
    $(AR) rc libgd.a gd.o gd_gd.o gd_gd2.o gd_io.o gd_io_dp.o \
        gd_io_file.o gd_ss.o gd_io_ss.o gd_png.o gd_jpeg.o gdxpm.o \
        gdfontt.o gdfonts.o gdfontmb.o gdfontl.o gdfontg.o \
        gdtables.o gdttf.o gdcache.o gdkanji.o wbmp.o gd_wbmp.o
    -ranlib libgd.a

clean:
    rm -f *.o *.a ${PROGRAMS} test/gdtest.jpg test/gdtest.wbmp

论坛徽章:
0
2 [报告]
发表于 2008-06-14 13:34 |只看该作者
没安装开发工具包
gcc
make
glibc-devel
等等

论坛徽章:
0
3 [报告]
发表于 2008-06-14 15:08 |只看该作者

回复 #1 kulouxia 的帖子

很明显是缺少开发工具包等。
如果是Debian或基于Debian的系统(如Ubuntu等),可以在root权限下执行
    apt-get install build-essential
来安装。
如果是基于Redhat的系统,不妨在安装包管理处把Development的包都装上。

论坛徽章:
0
4 [报告]
发表于 2008-06-14 15:19 |只看该作者
缺少GCC。要安装GCC。上面明明白白写的
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP