glib linker error (from libgettextsrc-0.16.dylib

Does this look familiar?

[...]
Making all in po
file=./`echo am | sed 's,.*/,,'`.gmo \
&& rm -f $file && /Users/holzensp/gtk/inst/bin/msgfmt -o $file am.po
dyld: lazy symbol binding failed: Symbol not found: _iconv_open
Referenced from: /Users/holzensp/gtk/inst/lib/libgettextsrc-0.16.dylib
Expected in: flat namespace

dyld: Symbol not found: _iconv_open
Referenced from: /Users/holzensp/gtk/inst/lib/libgettextsrc-0.16.dylib
Expected in: flat namespace

This is where the jhbuild breaks. I can reproduce it now (now that all stuff before glib is built) by typing "jhbuild buildone glib"

I'm not very well-informed with respect to the Mac ld. Any suggestions?

Could you type otool -L

Could you type otool -L /Users/holzensp/gtk/inst/lib/libgettextsrc-0.16.dylib
and paste the result here?

The symbol is defined in

The symbol is defined in libiconv.dylib, which can be loaded either from /usr/lib/libiconv.dylib or/Developer/SDKs/*/usr/lib/libiconv.dylib.

Run otool -L on your libgetextsrc-0.16.dylib and make sure a libiconv.dylib is linked into it, then check the path that it shows and that there's a libiconv where it points to. If it doesn't provide a path, ld should look in /usr/lib unless you've messed up your ld configuration somehow.

I fixed it. I had my

I fixed it. I had my DYLD_LIBRARY_PATH look at /opt/local/lib first (where my MacPorts libraries are). I'm still not quite used to the mac linker; if ~/gtk/inst/lib/libgettextsrc-0.16.dylib explicitly links against the libiconv in /usr/lib and the latter only references libraries in /usr/lib (which it does, according to otool - output below), then why is the stuff in /opt/local/lib a problem?

Output of otool et al:

~$ otool -L /Users/holzensp/gtk/inst/lib/libgettextsrc-0.16.dylib
/Users/holzensp/gtk/inst/lib/libgettextsrc-0.16.dylib:
/Users/holzensp/gtk/inst/lib/libgettextsrc-0.16.dylib (compatibility version 0.0.0, current version 0.0.0)
/Users/holzensp/gtk/inst/lib/libgettextlib-0.16.dylib (compatibility version 0.0.0, current version 0.0.0)
/Users/holzensp/gtk/inst/lib/libintl.8.dylib (compatibility version 9.0.0, current version 9.1.0)
/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 476.10.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
~$ otool -L /usr/lib/libiconv.dylib
/usr/lib/libiconv.dylib:
/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0)
~$ ls -la /usr/lib/libiconv*
lrwxr-xr-x 1 root wheel 16 26 Oct 2007 /usr/lib/libiconv.2.4.0.dylib -> libiconv.2.dylib
-rw-r--r-- 1 root wheel 4147008 23 Sep 2007 /usr/lib/libiconv.2.dylib
lrwxr-xr-x 1 root wheel 20 26 Oct 2007 /usr/lib/libiconv.dylib -> libiconv.2.4.0.dylib
-rw-r--r-- 1 root wheel 795 23 Sep 2007 /usr/lib/libiconv.la
~$