osx - GHC 6.12 and MacPorts -
i installed (from binary installers) ghc 6.12 , haskell platform 2010.1.0.1 on intel macbook running os x 10.5.8, , initially, worked fine. edit: had install cabal
, alex
, , happy
source, after that, did seem work fine. however, discovered if use cabal install
install package depends on macports library (e.g., cabal install --extra-lib-dirs=/opt/local/lib --extra-include-dirs=/opt/local/include gd
), things work fine in ghci, if try compile, error
linking test ... undefined symbols: "_iconv_close", referenced from: _hs_iconv_close in libhsbase-4.2.0.0.a(iconv.o) "_iconv", referenced from: _hs_iconv in libhsbase-4.2.0.0.a(iconv.o) "_iconv_open", referenced from: _hs_iconv_open in libhsbase-4.2.0.0.a(iconv.o) ld: symbol(s) not found collect2: ld returned 1 exit status
after googling, found a long haskell-cafe thread discussing problem. upshot seems macports installs updated version of libiconv, , binary interface different version included system. consequently, if try link macports library, macports libiconv gets linked in too; , since base library built link against different version of libiconv, things break. i've tried setting ld_library_path
, dyld_library_path
, adding more flags try @ /usr/lib
again (e.g. cabal install --extra-lib-dirs=/opt/local/lib --extra-include-dirs=/opt/local/include --extra-lib-dirs=/usr/lib --extra-include-dirs=/usr/include gd
), neither worked. uninstalling macports libiconv
isn't option, since have bunch of ports installed depend on it---including ports want haskell link to, gd2
.
from i've seen online, upshot seems "you're boned": cannot link against macports library while compiling ghc, , there doesn't seem solution. however, thread end of 2009, figure there's chance has solution, workaround, ridiculous hack… anything, really. so: does know how ghc 6.12 link against system libiconv @ same time links libraries macports? or, failing that, way make linking not break in other clever way?
i getting same error on macosx 10.5.8 when installed haskell-platform-2010.1.0.1-i386 , attempted compile haskell program. solution me add option "-l/usr/lib" ghc when compiling program. believe managed linker first search /usr/lib iconv library resolved problem me.
Comments
Post a Comment