#31193 [Opn->Fbk]: iconv.c:254 undefined reference to 'libiconv'

From: Date: Tue, 11 Jan 2005 05:54:18 +0000
Subject: #31193 [Opn->Fbk]: iconv.c:254 undefined reference to 'libiconv'
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-71820@lists.php.net to get a copy of this message
 ID:               31193
 Updated by:       moriyoshi@php.net
 Reported By:      david at cubbieco dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         Compile Failure
 Operating System: linux gcc-3.2
 PHP Version:      5.0.3


Previous Comments:
------------------------------------------------------------------------

[2005-01-11 06:53:09] moriyoshi@php.net

Where (and why) did you install libiconv ? It wouldn't 
be needed because glibc provides nearly the same 
functionality as libiconv. I think there's kind of 
confusion going on through configure. If you have 
installed libiconv in /usr on the linux box, you may 
finally have to restore the glibc devel package as 
installation of libiconv overwrites iconv.h that also 
comes from that package.

Compiler warnings are safe and just ignorable.

------------------------------------------------------------------------

[2005-01-10 22:45:16] nlopess@php.net

similar to #31263.

I can reproduce the first part (pointers warnings) on Solaris 9. The
link part has worked on my test box.

------------------------------------------------------------------------

[2005-01-10 20:50:08] david at cubbieco dot com

sorry... here is the pertanent info

./configure
make 
...

gcc  -Iext/dom/ -I/home/david/php-5.0.3/ext/dom/ -DPHP_ATOM_INC
-I/home/david/php-5.0.3/include -I/home/david/php-5.0.3/main
-I/home/david/php-5.0.3 -I/home/david/php-5.0.3/Zend
-I/usr/include/libxml2  -I/home/david/php-5.0.3/TSRM  -g -O2  -c
/home/david/php-5.0.3/ext/dom/userdatahandler.c -o
ext/dom/userdatahandler.o  && echo > ext/dom/userdatahandler.lo
gcc -I"/usr/include" -Iext/iconv/ -I/home/david/php-5.0.3/ext/iconv/
-DPHP_ATOM_INC -I/home/david/php-5.0.3/include
-I/home/david/php-5.0.3/main -I/home/david/php-5.0.3
-I/home/david/php-5.0.3/Zend -I/usr/include/libxml2 
-I/home/david/php-5.0.3/TSRM  -g -O2  -c
/home/david/php-5.0.3/ext/iconv/iconv.c -o ext/iconv/iconv.o  && echo >
ext/iconv/iconv.lo
cc1: warning: changing search order for system directory
"/usr/include"
cc1: warning:   as it has already been specified as a non-system
directory
/home/david/php-5.0.3/ext/iconv/iconv.c: In function
`_php_iconv_appendl':
/home/david/php-5.0.3/ext/iconv/iconv.c:254: warning: passing arg 2 of
`libiconv' from incompatible pointer type
/home/david/php-5.0.3/ext/iconv/iconv.c: In function
`_php_iconv_strlen':
/home/david/php-5.0.3/ext/iconv/iconv.c:528: warning: passing arg 2 of
`libiconv' from incompatible pointer type
/home/david/php-5.0.3/ext/iconv/iconv.c: In function
`_php_iconv_substr':
/home/david/php-5.0.3/ext/iconv/iconv.c:628: warning: passing arg 2 of
`libiconv' from incompatible pointer type
/home/david/php-5.0.3/ext/iconv/iconv.c: In function
`_php_iconv_strpos':
/home/david/php-5.0.3/ext/iconv/iconv.c:759: warning: passing arg 2 of
`libiconv' from incompatible pointer type
/home/david/php-5.0.3/ext/iconv/iconv.c: In function
`_php_iconv_mime_encode':
/home/david/php-5.0.3/ext/iconv/iconv.c:1012: warning: passing arg 2 of
`libiconv' from incompatible pointer type
/home/david/php-5.0.3/ext/iconv/iconv.c:1112: warning: passing arg 2 of
`libiconv' from incompatible pointer type
/home/david/php-5.0.3/ext/iconv/iconv.c: In function
`php_iconv_stream_filter_append_bucket':
/home/david/php-5.0.3/ext/iconv/iconv.c:2365: warning: passing arg 2 of
`libiconv' from incompatible pointer type
/home/david/php-5.0.3/ext/iconv/iconv.c:2444: warning: passing arg 2 of
`libiconv' from incompatible pointer type
gcc -DSUPPORT_UTF8 -DLINK_SIZE=2 -DPOSIX_MALLOC_THRESHOLD=10
-I/home/david/php-5.0.3/ext/pcre/pcrelib -Iext/pcre/
-I/home/david/php-5.0.3/ext/pcre/ -DPHP_ATOM_INC
-I/home/david/php-5.0.3/include -I/home/david/php-5.0.3/main
-I/home/david/php-5.0.3 -I/home/david/php-5.0.3/Zend
-I/usr/include/libxml2  -I/home/david/php-5.0.3/TSRM  -g -O2  -c
/home/david/php-5.0.3/ext/pcre/pcrelib/maketables.c -o
ext/pcre/pcrelib/maketables.o  && echo >
ext/pcre/pcrelib/maketables.lo
gcc -DSUPPORT_UTF8 -DLINK_SIZE=2 -DPOSIX_MALLOC_THRESHOLD=10
-I/home/david/php-5.0.3/ext/pcre/pcrelib -Iext/pcre/
-I/home/david/php-5.0.3/ext/pcre/ -DPHP_ATOM_INC
-I/home/david/php-5.0.3/include -I/home/david/php-5.0.3/main
-I/home/david/php-5.0.3 -I/home/david/php-5.0.3/Zend
-I/usr/include/libxml2  -I/home/david/php-5.0.3/TSRM  -g -O2  -c
/home/david/php-5.0.3/ext/pcre/pcrelib/get.c -o ext/pcre/pcrelib/get.o 
&& echo > ext/pcre/pcrelib/get.lo
...
gcc  -Isapi/cgi/ -I/home/david/php-5.0.3/sapi/cgi/ -DPHP_ATOM_INC
-I/home/david/php-5.0.3/include -I/home/david/php-5.0.3/main
-I/home/david/php-5.0.3 -I/home/david/php-5.0.3/Zend
-I/usr/include/libxml2  -I/home/david/php-5.0.3/TSRM  -g -O2  -c
/home/david/php-5.0.3/sapi/cgi/getopt.c -o sapi/cgi/getopt.o  && echo >
sapi/cgi/getopt.lo
gcc  -Imain/ -I/home/david/php-5.0.3/main/ -DPHP_ATOM_INC
-I/home/david/php-5.0.3/include -I/home/david/php-5.0.3/main
-I/home/david/php-5.0.3 -I/home/david/php-5.0.3/Zend
-I/usr/include/libxml2  -I/home/david/php-5.0.3/TSRM  -g -O2  -c
main/internal_functions.c -o main/internal_functions.o  && echo >
main/internal_functions.lo
/bin/sh /home/david/php-5.0.3/libtool --silent --preserve-dup-deps
--mode=link gcc -export-dynamic -g -O2     ext/libxml/libxml.lo
ext/ctype/ctype.lo ext/dom/php_dom.lo ext/dom/attr.lo
ext/dom/document.lo ext/dom/domerrorhandler.lo ext/dom/domstringlist.lo
ext/dom/domexception.lo ext/dom/namelist.lo
ext/dom/processinginstruction.lo ext/dom/cdatasection.lo
ext/dom/documentfragment.lo ext/dom/domimplementation.lo
ext/dom/element.lo ext/dom/node.lo ext/dom/string_extend.lo
ext/dom/characterdata.lo ext/dom/documenttype.lo
ext/dom/domimplementationlist.lo ext/dom/entity.lo ext/dom/nodelist.lo
ext/dom/text.lo ext/dom/comment.lo ext/dom/domconfiguration.lo
ext/dom/domimplementationsource.lo ext/dom/entityreference.lo
ext/dom/notation.lo ext/dom/xpath.lo ext/dom/dom_iterators.lo
ext/dom/typeinfo.lo ext/dom/domerror.lo ext/dom/domlocator.lo
ext/dom/namednodemap.lo ext/dom/userdatahandler.lo ext/iconv/iconv.lo
ext/pcre/pcrelib/maketables.lo ext/pcre/pcrelib/get.lo
ext/pcre/pcrelib/study.lo ext/pcre/pcrelib/pcre.lo ext/pcre/php_pcre.lo
ext/posix/posix.lo ext/session/session.lo ext/session/mod_files.lo
ext/session/mod_mm.lo ext/session/mod_user.lo
ext/simplexml/simplexml.lo ext/spl/php_spl.lo ext/spl/spl_functions.lo
ext/spl/spl_engine.lo ext/spl/spl_iterators.lo ext/spl/spl_array.lo
ext/spl/spl_directory.lo ext/spl/spl_sxe.lo ext/sqlite/sqlite.lo
ext/sqlite/sess_sqlite.lo ext/sqlite/libsqlite/src/opcodes.lo
ext/sqlite/libsqlite/src/parse.lo ext/sqlite/libsqlite/src/encode.lo
ext/sqlite/libsqlite/src/auth.lo ext/sqlite/libsqlite/src/btree.lo
ext/sqlite/libsqlite/src/build.lo ext/sqlite/libsqlite/src/delete.lo
ext/sqlite/libsqlite/src/expr.lo ext/sqlite/libsqlite/src/func.lo
ext/sqlite/libsqlite/src/hash.lo ext/sqlite/libsqlite/src/insert.lo
ext/sqlite/libsqlite/src/main.lo ext/sqlite/libsqlite/src/os.lo
ext/sqlite/libsqlite/src/pager.lo ext/sqlite/libsqlite/src/printf.lo
ext/sqlite/libsqlite/src/random.lo ext/sqlite/libsqlite/src/select.lo
ext/sqlite/libsqlite/src/table.lo ext/sqlite/libsqlite/src/tokenize.lo
ext/sqlite/libsqlite/src/update.lo ext/sqlite/libsqlite/src/util.lo
ext/sqlite/libsqlite/src/vdbe.lo ext/sqlite/libsqlite/src/attach.lo
ext/sqlite/libsqlite/src/btree_rb.lo ext/sqlite/libsqlite/src/pragma.lo
ext/sqlite/libsqlite/src/vacuum.lo ext/sqlite/libsqlite/src/copy.lo
ext/sqlite/libsqlite/src/vdbeaux.lo ext/sqlite/libsqlite/src/date.lo
ext/sqlite/libsqlite/src/where.lo ext/sqlite/libsqlite/src/trigger.lo
regex/regcomp.lo regex/regexec.lo regex/regerror.lo regex/regfree.lo
ext/standard/array.lo ext/standard/base64.lo
ext/standard/basic_functions.lo ext/standard/browscap.lo
ext/standard/crc32.lo ext/standard/crypt.lo ext/standard/cyr_convert.lo
ext/standard/datetime.lo ext/standard/dir.lo ext/standard/dl.lo
ext/standard/dns.lo ext/standard/exec.lo ext/standard/file.lo
ext/standard/filestat.lo ext/standard/flock_compat.lo
ext/standard/formatted_print.lo ext/standard/fsock.lo
ext/standard/head.lo ext/standard/html.lo ext/standard/image.lo
ext/standard/info.lo ext/standard/iptc.lo ext/standard/lcg.lo
ext/standard/link.lo ext/standard/mail.lo ext/standard/math.lo
ext/standard/md5.lo ext/standard/metaphone.lo ext/standard/microtime.lo
ext/standard/pack.lo ext/standard/pageinfo.lo ext/standard/parsedate.lo
ext/standard/quot_print.lo ext/standard/rand.lo ext/standard/reg.lo
ext/standard/soundex.lo ext/standard/string.lo ext/standard/scanf.lo
ext/standard/syslog.lo ext/standard/type.lo ext/standard/uniqid.lo
ext/standard/url.lo ext/standard/url_scanner.lo ext/standard/var.lo
ext/standard/versioning.lo ext/standard/assert.lo
ext/standard/strnatcmp.lo ext/standard/levenshtein.lo
ext/standard/incomplete_class.lo ext/standard/url_scanner_ex.lo
ext/standard/ftp_fopen_wrapper.lo ext/standard/http_fopen_wrapper.lo
ext/standard/php_fopen_wrapper.lo ext/standard/credits.lo
ext/standard/css.lo ext/standard/var_unserializer.lo
ext/standard/ftok.lo ext/standard/sha1.lo ext/standard/user_filters.lo
ext/standard/uuencode.lo ext/standard/filters.lo
ext/standard/proc_open.lo ext/standard/sunfuncs.lo
ext/standard/streamsfuncs.lo ext/standard/http.lo
ext/tokenizer/tokenizer.lo ext/xml/xml.lo ext/xml/compat.lo
TSRM/TSRM.lo TSRM/tsrm_strtok_r.lo TSRM/tsrm_virtual_cwd.lo
main/main.lo main/snprintf.lo main/spprintf.lo main/php_sprintf.lo
main/safe_mode.lo main/fopen_wrappers.lo main/alloca.lo
main/php_scandir.lo main/php_ini.lo main/SAPI.lo main/rfc1867.lo
main/php_content_types.lo main/strlcpy.lo main/strlcat.lo
main/mergesort.lo main/reentrancy.lo main/php_variables.lo
main/php_ticks.lo main/network.lo main/php_open_temporary_file.lo
main/php_logos.lo main/output.lo main/streams/streams.lo
main/streams/cast.lo main/streams/memory.lo main/streams/filter.lo
main/streams/plain_wrapper.lo main/streams/userspace.lo
main/streams/transports.lo main/streams/xp_socket.lo
main/streams/mmap.lo Zend/zend_language_parser.lo
Zend/zend_language_scanner.lo Zend/zend_ini_parser.lo
Zend/zend_ini_scanner.lo Zend/zend_alloc.lo Zend/zend_compile.lo
Zend/zend_constants.lo Zend/zend_dynamic_array.lo
Zend/zend_execute_API.lo Zend/zend_highlight.lo Zend/zend_llist.lo
Zend/zend_opcode.lo Zend/zend_operators.lo Zend/zend_ptr_stack.lo
Zend/zend_stack.lo Zend/zend_variables.lo Zend/zend.lo Zend/zend_API.lo
Zend/zend_extensions.lo Zend/zend_hash.lo Zend/zend_list.lo
Zend/zend_indent.lo Zend/zend_builtin_functions.lo Zend/zend_sprintf.lo
Zend/zend_ini.lo Zend/zend_qsort.lo Zend/zend_multibyte.lo
Zend/zend_ts_hash.lo Zend/zend_stream.lo Zend/zend_iterators.lo
Zend/zend_interfaces.lo Zend/zend_exceptions.lo Zend/zend_strtod.lo
Zend/zend_objects.lo Zend/zend_object_handlers.lo
Zend/zend_objects_API.lo Zend/zend_mm.lo Zend/zend_default_classes.lo
Zend/zend_reflection_api.lo Zend/zend_execute.lo sapi/cgi/cgi_main.lo
sapi/cgi/getopt.lo main/internal_functions.lo -lcrypt -lcrypt -lresolv
-lm -ldl -lnsl -lxml2 -lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt
-lxml2 -lz -lm -lcrypt  -o sapi/cgi/php
ext/iconv/iconv.o: In function `_php_iconv_appendl':
/home/david/php-5.0.3/ext/iconv/iconv.c:254: undefined reference to
`libiconv'
/home/david/php-5.0.3/ext/iconv/iconv.c:291: undefined reference to
`libiconv'
ext/iconv/iconv.o: In function `php_iconv_string':
/home/david/php-5.0.3/ext/iconv/iconv.c:347: undefined reference to
`libiconv_open'
/home/david/php-5.0.3/ext/iconv/iconv.c:356: undefined reference to
`libiconv'
/home/david/php-5.0.3/ext/iconv/iconv.c:369: undefined reference to
`libiconv'
/home/david/php-5.0.3/ext/iconv/iconv.c:380: undefined reference to
`libiconv_close'
ext/iconv/iconv.o: In function `_php_iconv_strlen':
/home/david/php-5.0.3/ext/iconv/iconv.c:505: undefined reference to
`libiconv_open'
/home/david/php-5.0.3/ext/iconv/iconv.c:528: undefined reference to
`libiconv'
/home/david/php-5.0.3/ext/iconv/iconv.c:561: undefined reference to
`libiconv_close'
ext/iconv/iconv.o: In function `_php_iconv_substr':
/home/david/php-5.0.3/ext/iconv/iconv.c:605: undefined reference to
`libiconv_open'
/home/david/php-5.0.3/ext/iconv/iconv.c:628: undefined reference to
`libiconv'
/home/david/php-5.0.3/ext/iconv/iconv.c:685: undefined reference to
`libiconv_close'
/home/david/php-5.0.3/ext/iconv/iconv.c:689: undefined reference to
`libiconv_close'
/home/david/php-5.0.3/ext/iconv/iconv.c:636: undefined reference to
`libiconv_open'
ext/iconv/iconv.o: In function `_php_iconv_strpos':
/home/david/php-5.0.3/ext/iconv/iconv.c:734: undefined reference to
`libiconv_open'
/home/david/php-5.0.3/ext/iconv/iconv.c:759: undefined reference to
`libiconv'
/home/david/php-5.0.3/ext/iconv/iconv.c:877: undefined reference to
`libiconv_close'
ext/iconv/iconv.o: In function `_php_iconv_mime_encode':
/home/david/php-5.0.3/ext/iconv/iconv.c:1200: undefined reference to
`libiconv_close'
/home/david/php-5.0.3/ext/iconv/iconv.c:1203: undefined reference to
`libiconv_close'
/home/david/php-5.0.3/ext/iconv/iconv.c:927: undefined reference to
`libiconv_open'
/home/david/php-5.0.3/ext/iconv/iconv.c:941: undefined reference to
`libiconv_open'
/home/david/php-5.0.3/ext/iconv/iconv.c:1112: undefined reference to
`libiconv'
/home/david/php-5.0.3/ext/iconv/iconv.c:1143: undefined reference to
`libiconv'
/home/david/php-5.0.3/ext/iconv/iconv.c:1187: undefined reference to
`libiconv'
/home/david/php-5.0.3/ext/iconv/iconv.c:1012: undefined reference to
`libiconv'
/home/david/php-5.0.3/ext/iconv/iconv.c:1044: undefined reference to
`libiconv'
ext/iconv/iconv.o:/home/david/php-5.0.3/ext/iconv/iconv.c:1060: more
undefined references to `libiconv' follow
ext/iconv/iconv.o: In function `_php_iconv_mime_decode':
/home/david/php-5.0.3/ext/iconv/iconv.c:1238: undefined reference to
`libiconv_open'
/home/david/php-5.0.3/ext/iconv/iconv.c:1705: undefined reference to
`libiconv_close'
/home/david/php-5.0.3/ext/iconv/iconv.c:1708: undefined reference to
`libiconv_close'
/home/david/php-5.0.3/ext/iconv/iconv.c:1349: undefined reference to
`libiconv_close'
/home/david/php-5.0.3/ext/iconv/iconv.c:1352: undefined reference to
`libiconv_open'
ext/iconv/iconv.o: In function `php_iconv_stream_filter_dtor':
/home/david/php-5.0.3/ext/iconv/iconv.c:2293: undefined reference to
`libiconv_close'
ext/iconv/iconv.o: In function `php_iconv_stream_filter_ctor':
/home/david/php-5.0.3/ext/iconv/iconv.c:2319: undefined reference to
`libiconv_open'
ext/iconv/iconv.o: In function
`php_iconv_stream_filter_append_bucket':
/home/david/php-5.0.3/ext/iconv/iconv.c:2365: undefined reference to
`libiconv'
/home/david/php-5.0.3/ext/iconv/iconv.c:2443: undefined reference to
`libiconv'
collect2: ld returned 1 exit status
make: *** [sapi/cgi/php] Error 1

it's the /bin/sh ... -o sapi/cgi/php (or sapi/cli/php) that fails. 
Adding a -liconv to that line makes it finish compiling (linking?) on
my machine.

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/31193

-- 
Edit this bug report at http://bugs.php.net/?id=31193&edit=1


Thread (18 messages)

« previous php.bugs (#71820) next »