系統環境CentOS linux 5.2
系統只安裝vi與開發工具
在編輯gd-2.0.32這個版本時出現以下錯誤:
[root@localhost gd-2.0.32]# make
make all-recursive
make[1]: Entering directory `/root/gd-2.0.32'
Making all in config
make[2]: Entering directory `/root/gd-2.0.32/config'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/root/gd-2.0.32/config'
Making all in test
make[2]: Entering directory `/root/gd-2.0.32/test'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/root/gd-2.0.32/test'
make[2]: Entering directory `/root/gd-2.0.32'
/bin/sh ./libtool --mode=link gcc -g -O2 -o gdparttopng gdparttopng.o ./libgd.la -lm
gcc -g -O2 -o .libs/gdparttopng gdparttopng.o ./.libs/libgd.so -lm -Wl,--rpath -Wl,/usr/local/gd/lib
gdparttopng.o: In function `main':
/root/gd-2.0.32/gdparttopng.c:42: undefined reference to `gdImageCreateFromGd2Part'
collect2: ld returned 1 exit status
make[2]: *** [gdparttopng] Error 1
make[2]: Leaving directory `/root/gd-2.0.32'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/gd-2.0.32'
make: *** [all] Error 2
搜索了不少文章,最終仍是這樣解決:
[root@localhost gd-2.0.32]# yum install libjpeg-devel freetype-devel libpng-devel 這樣安裝完後,再make下就沒問題。