Boost logo

Boost Testing :

Subject: Re: [Boost-testing] iconv library on Sandia-Darwin
From: Belcourt, Kenneth (kbelco_at_[hidden])
Date: 2011-07-26 14:09:23

Hi Artyom,

On Jul 23, 2011, at 2:18 PM, Artyom Beilis wrote:

> Basically you should be able to compile:
> #include <iconv.h>
> int main()
> {
> iconv_t d = iconv_open(0,0);
> (void)(d);
> }
> with g++ test.cpp -liconv

Yes, this works with default g++ on Snow Leopard (4.2.1).

It does indeed fail with the compiler I use for nightly testing (/opt/local/bin/g++-mp-4.4). This compiler generates a different symbol that the installed compiler.

[macsierra02:~] kbelco% /opt/local/bin/g++-mp-4.4 foo.cpp
Undefined symbols:
  "_libiconv_open", referenced from:
      _main in ccOff4HW.o

Notice with the default installed compiler the symbol name changes.

[macsierra02:~] kbelco% which g++

[macsierra02:~] kbelco% g++ --version
i686-apple-darwin10-g++-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5659)

[macsierra02:~] kbelco% g++ foo.cpp
Undefined symbols:
  "_iconv_open", referenced from:
      _main in cc2067qf.o

I'm not sure why the symbol is mangled to a different name with our compiler. It seems that our version of the compiler is incorrectly installed or at least not properly configured to build / link against iconv.

-- Noel

Boost-testing list run by mbergal at