-   Slackware (
-   -   Undefined reference to libiconv (

mjjzf 07-08-2005 10:52 AM

Undefined reference to libiconv
I was trying to install MagicPoint and got the following error message during 'make':

draw.o(.text+0x78b3): In function `xft_draw_fragment':
:undefined reference to `libiconv'
draw.o(.text+0x79c4): In function `xft_draw_fragment':
: undefined reference to `libiconv_open'

... any pointers? Libiconv is installed.

keefaz 07-08-2005 11:03 AM

Maybe you should try download and install this package :

mjjzf 07-08-2005 11:05 AM

I already have it installed.

keefaz 07-08-2005 11:07 AM

Did you run ldconfig as root ?

mjjzf 07-08-2005 11:14 AM

No result. What does it do? Any other parameters than just "ldconfig"?

keefaz 07-08-2005 11:26 AM

ldconfig updates the shared libraries links, so new installed
libraries are found by ld and the undefined reference should
go away

There is no other parameter, you run ldconfig and it updates
links following /etc/ (In fact ldconfig has more option
but none will be usefull here)

Where the libiconv is installed ? in /usr/lib or /usr/local/lib ?
(if /usr/local/lib, make sure this dir is in /etc/

Also try a ./configure again, then make

mjjzf 07-08-2005 11:47 AM

So I should do
ldconfig /usr/lib/
- that is the file placement - and then reattempt ./confgure?

keefaz 07-08-2005 11:52 AM

No, just type : ldconfig
Also maybe there is a ./configure option to
disable libiconv, I don't know, try ./configure --help

ideasman 08-17-2007 04:46 AM

The application Im compiling (stepmania) dosnt have the option to disable iconv, and Im getting.

RageUtil_CharConversions.o: In function `ConvertFromCharset(StdString::CStdStr<char>&, char const*)':
RageUtil_CharConversions.cpp:(.text+0x23): undefined reference to `libiconv_open'
RageUtil_CharConversions.cpp:(.text+0x96): undefined reference to `libiconv'
RageUtil_CharConversions.cpp:(.text+0xa0): undefined reference to `libiconv_close'
collect2: ld returned 1 exit status
make[2]: *** [stepmania] Error 1

Iv also installed libiconv-1.11.tar.gz and run ldconfig, so not sure whats going on.

andyccn 09-23-2007 01:53 PM

I was getting the same errors trying to compile PHP. Interestingly I only started getting the errors after installing iconv-1.11 (I needed it for another application.)

The iconv files sit inside /usr/local/lib and /usr/local/include, and I've ran ldconfig with the right directories, and the other applications that depend on iconv have compiled successfully.

In the end I've had to add --without-iconv to PHP's configure line.


willysr 09-23-2007 07:15 PM

same here
i always had problem with compiling libiconv on PHP
in the end, i can't get any XSLT features again

sourceforager 11-24-2008 06:57 PM

undefined reference to `libiconv_open'
To fix this error:
undefined reference to `libiconv_open'

Run configure like this:
[root@hotstname project-version]# ./configure CFLAGS=-liconv

samac 11-25-2008 04:37 AM

I had a problem similar to this with Neverwinter Nights, it requires libiconv. However another piece of software requires the iconv that is part of the glibc packet. To fix the problem I had to remove libiconv, reinstall glibc and then compile the software I had the problem with. I then reinstalled libiconv for Neverwinter Nights. Both bits of software now work fine.


v_2e 02-19-2013 11:39 AM


Originally Posted by sourceforager (Post 3353338)
To fix this error:
undefined reference to `libiconv_open'

Run configure like this:
[root@hotstname project-version]# ./configure CFLAGS=-liconv

In my case this variant:

./configure LIBS="-liconv"
worked better (produced no warnings).

All times are GMT -5. The time now is 07:17 PM.