大橙子网站建设,新征程启航
为企业提供网站建设、域名注册、服务器等服务
研究 PHP 源码的时候进行 make 之后报错:
目前创新互联公司已为上1000家的企业提供了网站建设、域名、网站空间、绵阳服务器托管、企业网站设计、南江网站维护等服务,公司将坚持客户导向、应用为本的策略,正道将秉承"和谐、参与、激情"的文化,与客户和合作伙伴齐心协力一起成长,共同发展。
/cli/ps_title.o sapi/cli/php_cli_process_title.o -lcrypt -lresolv -lcrypt -lrt -lrt -lm -ldl -lxml2 -lsqlite3 -lxml2 -lsqlite3 -lxml2 -lcrypt -lxml2 -lxml2 -lxml2 -lcrypt -o sapi/cli/php
ext/iconv/iconv.o: In function `php_iconv_stream_filter_dtor':
/home/work/tmp/php-src/ext/iconv/iconv.c:2513: undefined reference to `libiconv_close'
ext/iconv/iconv.o: In function `php_iconv_stream_filter_ctor':
/home/work/tmp/php-src/ext/iconv/iconv.c:2534: undefined reference to `libiconv_open'
ext/iconv/iconv.o: In function `_php_iconv_strlen':
/home/work/tmp/php-src/ext/iconv/iconv.c:668: undefined reference to `libiconv_open'
/home/work/tmp/php-src/ext/iconv/iconv.c:692: undefined reference to `libiconv'
/home/work/tmp/php-src/ext/iconv/iconv.c:726: undefined reference to `libiconv_close'
ext/iconv/iconv.o: In function `_php_iconv_appendl':
/home/work/tmp/php-src/ext/iconv/iconv.c:391: undefined reference to `libiconv'
/home/work/tmp/php-src/ext/iconv/iconv.c:425: undefined reference to `libiconv'
ext/iconv/iconv.o: In function `_php_iconv_substr':
/home/work/tmp/php-src/ext/iconv/iconv.c:789: undefined reference to `libiconv_open'
/home/work/tmp/php-src/ext/iconv/iconv.c:813: undefined reference to `libiconv'
/home/work/tmp/php-src/ext/iconv/iconv.c:868: undefined reference to `libiconv_close'
/home/work/tmp/php-src/ext/iconv/iconv.c:872: undefined reference to `libiconv_close'
/home/work/tmp/php-src/ext/iconv/iconv.c:821: undefined reference to `libiconv_open'
ext/iconv/iconv.o: In function `_php_iconv_mime_encode':
/home/work/tmp/php-src/ext/iconv/iconv.c:1107: undefined reference to `libiconv_open'
/home/work/tmp/php-src/ext/iconv/iconv.c:1121: undefined reference to `libiconv_open'
/home/work/tmp/php-src/ext/iconv/iconv.c:1293: undefined reference to `libiconv'
/home/work/tmp/php-src/ext/iconv/iconv.c:1325: undefined reference to `libiconv'
/home/work/tmp/php-src/ext/iconv/iconv.c:1381: undefined reference to `libiconv_close'
/home/work/tmp/php-src/ext/iconv/iconv.c:1384: undefined reference to `libiconv_close'
/home/work/tmp/php-src/ext/iconv/iconv.c:1240: undefined reference to `libiconv'
/home/work/tmp/php-src/ext/iconv/iconv.c:1192: undefined reference to `libiconv'
/home/work/tmp/php-src/ext/iconv/iconv.c:1224: undefined reference to `libiconv'
/home/work/tmp/php-src/ext/iconv/iconv.c:1368: undefined reference to `libiconv'
ext/iconv/iconv.o: In function `_php_iconv_mime_decode':
/home/work/tmp/php-src/ext/iconv/iconv.c:1419: undefined reference to `libiconv_open'
/home/work/tmp/php-src/ext/iconv/iconv.c:1941: undefined reference to `libiconv_close'
/home/work/tmp/php-src/ext/iconv/iconv.c:1944: undefined reference to `libiconv_close'
/home/work/tmp/php-src/ext/iconv/iconv.c:1557: undefined reference to `libiconv_close'
/home/work/tmp/php-src/ext/iconv/iconv.c:1560: undefined reference to `libiconv_open'
ext/iconv/iconv.o: In function `php_iconv_stream_filter_append_bucket':
/home/work/tmp/php-src/ext/iconv/iconv.c:2578: undefined reference to `libiconv'
/home/work/tmp/php-src/ext/iconv/iconv.c:2651: undefined reference to `libiconv'
/home/work/tmp/php-src/ext/iconv/iconv.c:2650: undefined reference to `libiconv'
ext/iconv/iconv.o: In function `php_iconv_string':
/home/work/tmp/php-src/ext/iconv/iconv.c:497: undefined reference to `libiconv_open'
/home/work/tmp/php-src/ext/iconv/iconv.c:506: undefined reference to `libiconv'
/home/work/tmp/php-src/ext/iconv/iconv.c:522: undefined reference to `libiconv'
/home/work/tmp/php-src/ext/iconv/iconv.c:532: undefined reference to `libiconv_close'
ext/iconv/iconv.o: In function `_php_iconv_strpos':
/home/work/tmp/php-src/ext/iconv/iconv.c:916: undefined reference to `libiconv_open'
/home/work/tmp/php-src/ext/iconv/iconv.c:944: undefined reference to `libiconv'
/home/work/tmp/php-src/ext/iconv/iconv.c:1058: undefined reference to `libiconv_close'
collect2: error: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1
表面看,是libiconv安装问题,重装libiconv之后问题依旧,网上看有人舍弃libiconv,使用 –without-iconv,觉得不可取,这样是回避问题。 找了n久,终于找到bug所在: 在执行完 ./configure …之后,修改下 Makefile,找到其中的
EXTRA_LIBS = -lcrypt -lresolv -lcrypt -lrt -lrt -lm -ldl -lxml2 -lsqlite3 -lxml2 -lsqlite3 -lxml2 -lcrypt -lxml2 -lxml2 -lxml2 -lcrypt
在其后增加一个 -liconv参数:
EXTRA_LIBS = -lcrypt -lresolv -lcrypt -lrt -lrt -lm -ldl -lxml2 -lsqlite3 -lxml2 -lsqlite3 -lxml2 -lcrypt -lxml2 -lxml2 -lxml2 -lcrypt -liconv
参考:
PHP 编译安装时出现 undefined reference to `libiconv' 错误的解决方法