<div dir="ltr"><div><div dir="ltr">I had almost the same problem. You probably have two versions of the iconv library, which don't use exactly the same symbols, which could be the case if you have one version installed with MacPorts. For some reason, it does not link to the library corresponding to the header it has included, so there is a problem with symbols. Right after the error message you copied, there must be the exact command that failed, which may help figure it out. You can do a 'find / -name "*iconv*" to find where your (possibly duplicate) iconv libraries are. In any case I would recommend having just one copy, or just not use MacPorts, but Homebrew, which does not duplicate libraries. <br>

</div></div><div class="gmail_quote"><div dir="ltr"><div>

<br></div><div>Hope that helps.<br><div><div><div><br><div><div><div><div dir="ltr"><span style="font-family:arial;font-size:small">Catherine</span><div style="font-family:arial;font-size:small"><br></div><blockquote style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex" class="gmail_quote">



<b style="color:rgb(0,0,0);font-family:Times;font-size:medium">mohsen jadidi</b><span style="color:rgb(0,0,0);font-family:Times;font-size:medium"> </span><a href="mailto:srilm-user%40speech.sri.com?Subject=Re%3A%20%5BSRILM%20User%20List%5D%20installation%20on%20mac%20lion%20error%20on%20negram%20class&In-Reply-To=%3CCAOfo52ARnG9%2BA7Y0Zv6htTtYP7yYMEbbC9Z-%3DaHebSariNUfCg%40mail.gmail.com%3E" title="[SRILM User List] installation on mac lion error on negram class" style="font-family:Times;font-size:medium" target="_blank">mohsen.jadidi at gmail.com </a><br style="color:rgb(0,0,0);font-family:Times;font-size:medium">



<i style="color:rgb(0,0,0);font-family:Times;font-size:medium">Wed Mar 13 08:03:20 PDT 2013</i><hr style="color:rgb(0,0,0);font-family:Times;font-size:medium"><pre style="white-space:pre-wrap;color:rgb(0,0,0)">I managed to run my program after installing the srilm
with NO_ICONV=anything . Otherwise it keeps giving me this error:


Undefined symbols for architecture x86_64:
  "_iconv", referenced from:
      File::fgetsUTF8(char*, int)in libmisc.a(File.o)
  "_iconv_close", referenced from:
      File::reopen(char const*)in libmisc.a(File.o)
      File::reopen(std::basic_string<char, std::char_traits<char>,
std::allocator<char> >&, int)in libmisc.a(File.o)
      File::reopen(char const*, unsigned long, int)in libmisc.a(File.o)
      File::reopen(char const*, char const*)in libmisc.a(File.o)
      File::~File() in libmisc.a(File.o)
      File::~File() in libmisc.a(File.o)
  "_iconv_open", referenced from:
      File::fgetsUTF8(char*, int)in libmisc.a(File.o)
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status

I read some pages and they suggested problem comes from the different
version of iconv,(The Mac default library and Macport installation).  I
couldn't realize how to fix the problem. I tried to set   ADDITIONAL_CFLAGS
= /usr/lib/libiconv.2.dylib but didnt work.
These are some information you might find useful :
For default version in /usr/lib I have :

ls -ll libiconv*
lrwxr-xr-x  1 root  wheel       16 Oct  8  2011 libiconv.2.4.0.dylib ->
libiconv.2.dylib
-r-xr-xr-x  1 root  wheel  2105216 Oct  8  2011 libiconv.2.dylib
lrwxr-xr-x  1 root  wheel       20 Oct  8  2011 libiconv.dylib ->
libiconv.2.4.0.dylib

none of them have (*) to indicate which one my compiler use?! Also,

nm libiconv.2.dylib | grep iconv
00000000000f1af0 S ___iconv_2VersionNumber
00000000000f1b90 S ___iconv_2VersionString
00000000000f60f0 D __libiconv_version
000000000000a1e1 T _iconv
000000000000a5a0 T _iconv_canonicalize
0000000000013164 T _iconv_close
0000000000013171 T _iconv_open
000000000000a72c T _iconvctl
000000000000a20f T _iconvlist
0000000000014dbd T _libiconv_relocate
0000000000014cff T _libiconv_set_relocation_prefix

For Macport version I have :

-rw-r--r--  1 root  admin  1072264 Apr  4  2012 libiconv.2.dylib
-rw-r--r--  1 root  admin  1098856 Apr  4  2012 libiconv.a
lrwxr-xr-x  1 root  admin       16 Apr  4  2012 libiconv.dylib ->
libiconv.2.dylib
-rw-r--r--  1 root  admin      914 Apr  4  2012 <a href="http://libiconv.la" target="_blank">libiconv.la</a>

and also:

 nm libiconv.a | grep iconv
libiconv.a(iconv.o):
0000000000016780 D __libiconv_version
000000000000ac10 T _iconv_canonicalize
00000000000f9908 S _iconv_canonicalize.eh
000000000000a810 T _libiconv
00000000000f97d0 S _libiconv.eh
00000000000159f0 T _libiconv_close
00000000000fa6c0 S _libiconv_close.eh
0000000000015a00 T _libiconv_open
00000000000fa6f0 S _libiconv_open.eh
0000000000014950 T _libiconv_open_into
00000000000fa518 S _libiconv_open_into.eh
000000000000adc0 T _libiconvctl
00000000000f9940 S _libiconvctl.eh
000000000000a850 T _libiconvlist
00000000000f9830 S _libiconvlist.eh
libiconv.a(localcharset.o):
libiconv.a(relocatable.o):
00000000000000c0 T _libiconv_relocate
00000000000001d0 S _libiconv_relocate.eh
0000000000000000 T _libiconv_set_relocation_prefix
0000000000000198 S _libiconv_set_relocation_prefix.eh


Do you have any suggestion ?

</pre></blockquote></div></div>
</div></div></div></div></div></div></div>
<br></div><br></div>