I'm using Haskell Platform 2011.2.0.1 installed via Homebrew. I have set up a cabalised project with relevant dependencies all defined. The executable does nothing more than to print out the arguments passed in to it. The program compiles and links correctly, but when the program ...
Main.hs:
main = do
args <- getArgs
putStrLn "Here are your arguments!:"
forM_ args putStrLn
... is run, I get ...
Trace:
$ cabal configure
Resolving dependencies...
Configuring foo-0.1...
$ cabal build
Preprocessing executables for foo-0.1...
Preprocessing test suites for foo-0.1...
Building foo-0.1...
$ dist/build/foobar/foobar some arguments
foobar: mkTextEncoding: failed (Unknown error: 0)
FAIL: 1
The relevant part of my PATH variable reads: /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/texbin:/usr/X11/bin
I'm thinking that this is a problem related to libiconv
. Any ideas? Thanks!
Thanks to Daniel and John's inputs, I found out the solution to my own problem.
In my case,
foobar: mkTextEncoding: failed (Unknown error: 0) FAIL: 1
was caused by a dodgy linkage to thegd
library.The issue can be seen by inspecting the binary's used libraries.
The odd line out of course shows us the culprit:
The version and location looks odd. Removing the dependency on
gd
made my program work again. However, I've not managed to getlibgd
working on my Mac. That problem is out of the scope of this question.