编译gdlib库碰到undefined reference to `png_check_sig’问题解决

采用源码方式编译php,需要gd库,同样采用源码编译,在编译过程中碰到 undefined reference to `png_check_sig’ 错误。
google了一下,发现由于使用的新的 libpng 1.4版本,去掉了png_check_sig函数,替换为了png_sig_check函数
,于是编辑gd库的 gd_png.c文件,将

  1. if (!png_check_sig (sig, 8)) { /* bad signature */
  2.   return NULL;
  3. }

修改为

  1. if (png_sig_cmp (sig, 0, 8)) { /* bad signature */
  2.   return NULL;
  3. }

再次编译通过

Popularity: 34% [?]

Related

源码安装Mysql提示No curses/termcap library found

使用源码方式安装Mysql5.0,提示No curses/termcap library found
google了一下,
下载一个ncurses-5.6.tar.gz安装,

  1. wget http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.6.tar.gz
  2. tar zxvf ncurses-5.6.tar.gz
  3. cd ncurses-5.6
  4. ./configure –prefix=/usr –with-shared –without-debug
  5. make
  6. make install clean

网上还有一篇说在./configure 时添加 –with-named-curses-libs=/usr/lib/libncurses.so.5 解决,但是添加后虽然./configure通过,但是在make时失败
在这儿记录一下

Popularity: 39% [?]

Related