Repository: IHaskell/IHaskell

Issue #563: Unable to compile under OSX: undefined symbol "_iconv"
Created: 2015-08-25T16:24:23Z
Attempting to install under Mac OSX (10.10.4), I receive the linker error:
    [2 of 2] Compiling Main             ( doc/examples/TicTacToe.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build/operational-TicTacToe/operational-TicTacToe-tmp/Main.o )
    Linking .stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build/operational-TicTacToe/operational-TicTacToe ...
    Undefined symbols for architecture x86_64:
      "_iconv", referenced from:
          _hs_iconv in libHSbase-4.8.1.0-GDytRqRVSUX7zckgKqJjgw.a(iconv.o)
         (maybe you meant: _hs_iconv, ... )
      "_iconv_close", referenced from:
          _hs_iconv_close in libHSbase-4.8.1.0-GDytRqRVSUX7zckgKqJjgw.a(iconv.o)
         (maybe you meant: _hs_iconv_close)
      "_iconv_open", referenced from:
          _hs_iconv_open in libHSbase-4.8.1.0-GDytRqRVSUX7zckgKqJjgw.a(iconv.o)
         (maybe you meant: _hs_iconv_open)
      "_locale_charset", referenced from:
          _localeEncoding in libHSbase-4.8.1.0-GDytRqRVSUX7zckgKqJjgw.a(PrelIOUtils.o)
    ld: symbol(s) not found for architecture x86_64

I get this error whether I attempt to build with stack install ihaskell --resolver lts-3.1, or with stack build --extra-lib-dirs=/opt/local/lib/ --extra-include-dirs=/opt/local/include/ using the latest from github (069a2638fd8 as of writing).
I have libiconv installed under /opt/local.

Duplicate issue #1079: Mac installation failing at: `stack install --fast`, step.
Created: 2019-07-25T23:23:27Z
I'm attempting to install on a Mac, following the instructions in the Mac section of the README. And I'm getting the following failure when I attempt the stack install --fast command:
    Preprocessing executable 'aeson-pretty' for aeson-pretty-0.8.7..
    Building executable 'aeson-pretty' for aeson-pretty-0.8.7..
    [1 of 2] Compiling Paths_aeson_pretty ( .stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/aeson-pretty/autogen/Paths_aeson_pretty.hs, .stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/aeson-pretty/aeson-pretty-tmp/Paths_aeson_pretty.o )
    [2 of 2] Compiling Main             ( cli-tool/Main.hs, .stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/aeson-pretty/aeson-pretty-tmp/Main.o )
    Linking .stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/aeson-pretty/aeson-pretty ...
    Undefined symbols for architecture x86_64:
      "_iconv", referenced from:
          _hs_iconv in libHSbase-4.12.0.0.a(iconv.o)
         (maybe you meant: _base_GHCziIOziEncodingziIconv_iconvEncoding14_bytes, _base_GHCziIOziEncodingziIconv_iconvEncoding4_info , _hs_iconv_open , _base_GHCziIOziEncodingziIconv_iconvEncoding1_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding1_info , _base_GHCziIOziEncodingziIconv_iconvEncoding4_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding7_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding15_info , _base_GHCziIOziEncodingziIconv_iconvEncoding7_info , _base_GHCziIOziEncodingziIconv_iconvEncoding6_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding6_info , _hs_iconv , _base_GHCziIOziEncodingziIconv_iconvEncoding5_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding8_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding8_info , _base_GHCziIOziEncodingziIconv_iconvEncoding12_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding9_info , _base_GHCziIOziEncodingziIconv_iconvEncoding12_info , _base_GHCziIOziEncodingziIconv_iconvEncoding13_info , _base_GHCziIOziEncodingziIconv_iconvEncoding11_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding11_info , _base_GHCziIOziEncodingziIconv_iconvEncoding2_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding2_info , _base_GHCziIOziEncodingziIconv_iconvEncoding10_bytes , _hs_iconv_close , _base_GHCziIOziEncodingziIconv_iconvEncoding13_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding_info , _base_GHCziIOziEncodingziIconv_iconvEncoding3_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding15_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding9_closure )
      "_iconv_open", referenced from:
          _hs_iconv_open in libHSbase-4.12.0.0.a(iconv.o)
         (maybe you meant: _hs_iconv_open)
      "_iconv_close", referenced from:
          _hs_iconv_close in libHSbase-4.12.0.0.a(iconv.o)
         (maybe you meant: _hs_iconv_close)
      "_locale_charset", referenced from:
          _localeEncoding in libHSbase-4.12.0.0.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)
    `gcc' failed in phase `Linker'. (Exit code: 1)

I'm not sure how to debug this.
System Info:
(base)
dbanas@Davids-MacBook-Pro:~/Documents/Projects/IHaskell
$ which stack
/Library/Haskell/bin/stack
(base)
dbanas@Davids-MacBook-Pro:~/Documents/Projects/IHaskell
$ stack --version
Version 1.9.3, Git revision 40cf7b37526b86d1676da82167ea8758a854953b (6211 commits) x86_64 hpack-0.31.1
(base)
dbanas@Davids-MacBook-Pro:~/Documents/Projects/IHaskell
$ stack exec which ghc
/Users/dbanas/.stack/programs/x86_64-osx/ghc-8.6.5/bin/ghc
(base)
dbanas@Davids-MacBook-Pro:~/Documents/Projects/IHaskell
$ stack exec -- ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.6.5

Closing comment (2019-07-26T03:04:25Z): Sorry, duplicate of #563; closing.