编译GD库时找不到png

发布于 2021-11-25 06:17:31 字数 6377 浏览 935 评论 2

场景:CentOS5.8 + libpng1.6.1 + gd-2.033

编译GD库之前已经将libpng, jpeg, freetype, zlib 等包都编译安装在 /usr/local/ 下,

但是GD老是提示support for PNG library no, 只有jpeg能够识别,

修改过gd/gd_png.c 中的png.h路径,也是没有效果!

[root@localhost gd-2.0.33]# ./configure --prefix=/usr/local/gd2 --with-png=/usr/local/libpng
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ANSI C... (cached) none needed
checking dependency style of gcc... (cached) gcc3
checking for a BSD-compatible install... /usr/bin/install -c
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for ld used by GCC... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking for a sed that does not truncate output... /bin/sed
checking whether ln -s works... yes
checking how to recognise dependent libraries... pass_all
checking command to parse /usr/bin/nm -B output... ok
checking how to run the C preprocessor... gcc -E
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for ranlib... ranlib
checking for strip... strip
checking for objdir... .libs
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.lo... yes
checking if gcc supports -fno-rtti -fno-exceptions... no
checking whether the linker (/usr/bin/ld) supports shared libraries... yes
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking whether -lc should be explicitly linked in... no
creating libtool
checking whether ln -s works... yes
checking whether make sets $(MAKE)... (cached) yes
checking for ranlib... (cached) ranlib
checking for X... no
checking for ANSI C header files... (cached) yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for unistd.h... (cached) yes
checking for ld used by GCC... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for shared library run path origin... done
checking for iconv... yes
checking for iconv declaration... 
         extern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
checking iconv.h usability... yes
checking iconv.h presence... yes
checking for iconv.h... yes
checking whether iconv.h defines iconv_t... yes
checking for sin... no
checking for sin in -lm... yes
checking for deflate in -lz... no
configure: WARNING: zlib is required - see http://www.gzip.org/zlib/
checking for libpng12-config... no
checking for libpng-config... no
checking png.h usability... no
checking png.h presence... no
checking for png.h... no
checking libpng/png.h usability... no
checking libpng/png.h presence... no
checking for libpng/png.h... no
checking for png_create_read_struct in -lpng... no
configure: WARNING: libpng is required - see http://www.libpng.org/pub/png/
checking for freetype-config... no
checking for FT_Init_FreeType in -lfreetype... no
configure: WARNING: not found - disabling freetype support
checking ft2build.h usability... no
checking ft2build.h presence... no
checking for ft2build.h... no
no
checking for FcInit in -lfontconfig... no
checking for jpeg_set_defaults in -ljpeg... no
checking for XpmReadFileToXpmImage in -lXpm... no
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... no
checking whether pthreads work with -Kthread... no
checking whether pthreads work with -kthread... no
checking for the pthreads library -llthread... no
checking whether pthreads work with -pthread... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... no
checking for cc_r... gcc


** Configuration summary for gd 2.0.33:


   Support for PNG library:          no
   Support for JPEG library:         no
   Support for Freetype 2.x library: no
   Support for Fontconfig library:   no
   Support for Xpm library:          no
   Support for pthreads:             yes


configure: creating ./config.status
config.status: creating Makefile
config.status: creating config/Makefile
config.status: creating config/gdlib-config
config.status: creating test/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands




如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

瑾兮 2021-11-26 16:55:39

我在6.5上编译安装php,自己在/usr/local下编译安装libpng等依赖包,从来没成功过。只能用centos自带的libpng等包,而且64位下还需要把lib64下的libpng.so软链接到lib下才行。。

牵你的手,一向走下去 2021-11-26 15:03:14

我在6.5上编译安装php,自己在/usr/local下编译安装libpng等依赖包,从来没成功过。只能用centos自带的libpng等包,而且64位下还需要把lib64下的libpng.so软链接到lib下才行。。

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文