Error when running `cabal install cabal-install`

~$ cabal --version cabal-install version 1.18.0.5 using version 1.18.1.4 of the Cabal library ~$ ghc --version The Glorious Glasgow Haskell Compilation System, version 7.8.3 I got the following error. Does anybody know how to resolve it? Thanks. ~$ cabal install cabal-install Resolving dependencies... Configuring Cabal-1.22.3.0... Failed to install Cabal-1.22.3.0 Last 10 lines of the build log ( /Users/py/.cabal/logs/Cabal-1.22.3.0.log ): cabal: Error: some packages failed to install: Cabal-1.22.3.0 failed during the configure step. The exception was: user error (Undefined symbols for architecture x86_64: "_iconv", referenced from: _hs_iconv in libHSbase-4.7.0.1.a(iconv.o) (maybe you meant: _hs_iconv, _base_GHCziIOziEncodingziIconv_iconvEncodingzuloc1_info , _base_GHCziIOziEncodingziIconv_iconvEncoding9_info , _base_GHCziIOziEncodingziIconv_iconvEncoding9_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding8_info , _base_GHCziIOziEncodingziIconv_iconvEncodingzuloc_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding10_info , _base_GHCziIOziEncodingziIconv_iconvEncoding6_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding10_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding3_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding7_info , _hs_iconv_close , _base_GHCziIOziEncodingziIconv_iconvEncodingzuloc1_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding2_info , _base_GHCziIOziEncodingziIconv_iconvEncoding8_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding3_info , _base_GHCziIOziEncodingziIconv_iconvEncoding2_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding7_closure , _base_GHCziIOziEncodingziIconv_iconvEncodingzuloc_info , _base_GHCziIOziEncodingziIconv_iconvEncoding4_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding6_info , _hs_iconv_open ) "_iconv_close", referenced from: _hs_iconv_close in libHSbase-4.7.0.1.a(iconv.o) (maybe you meant: _hs_iconv_close) "_iconv_open", referenced from: _hs_iconv_open in libHSbase-4.7.0.1.a(iconv.o) (maybe you meant: _hs_iconv_open) "_locale_charset", referenced from: _localeEncoding in libHSbase-4.7.0.1.a(PrelIOUtils.o) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ) cabal-install-1.22.3.0 depends on Cabal-1.22.3.0 which failed to install. ~/ports$ gvim ~/.cabal/logs/ -- Regards, Peng

On Thu, Apr 23, 2015 at 3:39 PM, Peng Yu
user error (Undefined symbols for architecture x86_64: "_iconv", referenced from:
OS X? Do you have MacPorts or Homebrew installed? Where did you get your ghc from? (I've also seen this on FreeBSD due to a conflict between ports iconv and the base system, but its ld produces a slightly different error message.) -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

It is installed from https://www.haskell.org/platform/. The OS is Mac OS X.
~$ type -P ghc
/usr/bin/ghc
~$ type -P cabal
/usr/bin/cabal
On Thu, Apr 23, 2015 at 2:57 PM, Brandon Allbery
On Thu, Apr 23, 2015 at 3:39 PM, Peng Yu
wrote: user error (Undefined symbols for architecture x86_64: "_iconv", referenced from:
OS X? Do you have MacPorts or Homebrew installed? Where did you get your ghc from?
(I've also seen this on FreeBSD due to a conflict between ports iconv and the base system, but its ld produces a slightly different error message.)
-- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
_______________________________________________ Beginners mailing list Beginners@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
-- Regards, Peng

On Thu, Apr 23, 2015 at 4:19 PM, Peng Yu
It is installed from <https://www.haskell.org/platform/
. The OS is Mac OS X.
Yes, as I suspected. The problem is that Apple ships an old version of the iconv library; MacPorts and Homebrew generally install a newer, incompatible one with symbols renamed to trigger that link error (because otherwise you find out about the mismatch when the first iconv call dumps core at runtime). You will need to arrange for ghc not to see that other iconv, only Apple's, since it won't work with any but Apple's. Or use a ghc from whichever package manager you have installed, so that it works with that package manager's iconv library. (This is more likely to happen with Homebrew, since most things don't look /opt/local but just about everything looks under /usr/local.) -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
participants (2)
-
Brandon Allbery
-
Peng Yu