Re: [code] Small quirk in Makefile for FreeBSD

From: Wolfgang Jenkner <>
Date: Sat, 26 Mar 2016 15:57:11 +0100

On Thu, Mar 24 2016, Mitchell wrote:

> On Sat, 27 Feb 2016, Martin \"eto\" Misuth wrote:
>> As far as I know iconv is part of FreeBSD base some time now - that means no
>> package provides it (unless it's some port add-on override) and all
>> applications should use system version.

Yes, but glib-2.0 is linked to libiconv on FreeBSD, please see

$ ldd /usr/local/lib/
/usr/local/lib/ => /usr/local/lib/ (0x800ed4000) => /usr/local/lib/ (0x8011ce000) => /usr/local/lib/ (0x801444000) => /lib/ (0x80164f000) => /lib/ (0x800821000)

> Sorry for the delay, but I had some time to look into this this
> morning. I think the reason why iconv isn't explicitly linked on GTK
> on *BSD is because I'm expecting `pkg-config --libs gtk+-2.0` to
> include `-liconv` in its output. I presume on your machine the above
> command does not output `-liconv` somewhere?

No, -liconv is only part of Libs.private in glib-2.0.pc, cf.

IIUC, compiling textadept.c correctly includes iconv.h from libiconv
(because the compilation flags include -I/usr/local/include somewhere),
which, among other things, contains

#define iconv_open libiconv_open

but the problem is that the latter symbol isn't re-exported from glib

$ nm /usr/local/lib/ | grep iconv
0000000000030000 T g_convert_with_iconv
000000000002ffe0 T g_iconv
000000000002fff0 T g_iconv_close
000000000002fe90 T g_iconv_open
                 U libiconv
                 U libiconv_close
                 U libiconv_open

hence the error message from the linker

/usr/bin/ld: undefined reference to symbol `libiconv_open' (try adding -liconv)


You are subscribed to
To change subscription settings, send an e-mail to
To unsubscribe, send an e-mail to
Received on Sat 26 Mar 2016 - 10:57:11 EDT

This archive was generated by hypermail 2.2.0 : Sun 27 Mar 2016 - 06:43:08 EDT