网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

undefinedreferenceto`libico

研究 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' 错误的解决方法


文章标题:undefinedreferenceto`libico
网址分享:http://bjjierui.cn/article/gjpsds.html

其他资讯