[Haskell-cafe] Haskeline, pcre-light, iconv and Cabal on OSX
Thomas Davie
tom.davie at gmail.com
Sun Feb 1 13:01:39 EST 2009
This is caused by OS X's libiconv being entirely CPP macros, the FFI
has nothing to get hold of. IIRC there's a ghc bug report open for it.
Bob
On 1 Feb 2009, at 18:57, Antoine Latter wrote:
> Funny story,
>
> If I do the following three things, I get errors on my Intel Mac OS
> 10.5:
>
> * Build an executable with Cabal
> * Have the executable have a build-dep of pcre-light in the .cabal
> * use haskeline in the executable itself
>
> I get crazy linker errors relating to haskeline and libiconv:
>
> Shell output:
>>>>>>
> $ cabal clean && cabal configure && cabal build
> cleaning...
> Configuring test-0.0.0...
> Preprocessing executables for test-0.0.0...
> Building test-0.0.0...
> [1 of 1] Compiling Main ( test.hs, dist/build/test/test-
> tmp/Main.o )
> Linking dist/build/test/test ...
> Undefined symbols:
> "_iconv_open", referenced from:
> _s9Qa_info in libHShaskeline-0.6.0.1.a(IConv.o)
> "_iconv_close", referenced from:
> _iconv_close$non_lazy_ptr in libHShaskeline-0.6.0.1.a(IConv.o)
> "_iconv", referenced from:
> _sa0K_info in libHShaskeline-0.6.0.1.a(IConv.o)
> ld: symbol(s) not found
> collect2: ld returned 1 exit status
> <<<<<
>
> But all three above conditions need to be true - if I build using 'ghc
> --make' everything works great, even if the executable imports
> pcre-light and haskeline. If I have build-deps on haskeline and
> pcre-light, but don't actually import haskeline, everything also works
> great.
>
> Here are the files I've used:
>
> test.hs:
>>>>>>
> import System.Console.Haskeline
>
> main :: IO ()
> main = print "Hello!"
> <<<<<
>
> test.cabal
>>>>>>
> Name: test
> version: 0.0.0
> cabal-version: >= 1.2
> build-type: Simple
>
> Executable test
> main-is: test.hs
> build-depends: base, haskeline, pcre-light>=0.3
> <<<<<
>
> Is there some way I need to be building haskeline on OS X to make
> this work?
>
> Thanks,
> Antoine
>
> more details:
>
>>>>>>
> $ cabal --version
> cabal-install version 0.6.0
> using version 1.6.0.1 of the Cabal library
> <<<<<
>
>>>>>>
> $ ghc --version
> The Glorious Glasgow Haskell Compilation System, version
> 6.10.0.20081007
> <<<<<
>
> links:
> pcre-light: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/pcre-light
> haskeline: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/haskeline
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
More information about the Haskell-Cafe
mailing list