Bug #2191
iconv detection fails with glibc (linux)
0%
Description
The configure script that detects iconv, explicitly links with "-liconv". However iconv functions are part of the standard gnu lib C and as such there is no separate libiconv.so . As result the detection fails with missing library.
Removing the -liconv from configure and Makefile allows me to use iconv functionality.
History
Updated by Jaroslav Kysela over 10 years ago
File:
#include <iconv.h>
int test(void)
{
iconv_t ic = iconv_open("ASCII", "ASCII");
return 0;
}
int main() {
test();
}
Test cmd:
$ gcc a.c -liconv
/usr/bin/ld: cannot find -liconv
collect2: error: ld returned 1 exit status
All is ok here with glibc.. Could you check why the -liconv does not fail in your gcc setup ?
Updated by Ivan Kalvachev over 10 years ago
Jaroslav Kysela wrote:
All is ok here with glibc.. Could you check why the -liconv does not fail in your gcc setup ?
It does fail.
And this is quite visible in the configure output.
Since iconv functionality is new one, I assumed that this configure check test the presence of iconv functions. Not that it only checks if explicit iconv library is needed.
There are 3 possible cases:
1. iconv functions in libiconv
2. iconv functions in glibc
3. no iconv.
You seem to assume that iconv is always available and distinguish only between case 1 vs case 2.
In short, there is no bug, just slightly misleading configure output.
Updated by Jaroslav Kysela over 10 years ago
- Status changed from New to Invalid
IConv is mandatory. If you have a better way to detect -liconv requirement, please, show it in a patch.