
I am in my yearly fightto get a working combination of operating system (Snow Leopard), compiler version (6.12) , wxWidgets and wxHaskell on my Mac . After deleting most of my stuff, starting afresh, hours of building using macports etc. I finally get the message: loeki:Opgave doaitse$ ghc --make Turtle.hs [1 of 1] Compiling Main ( Turtle.hs, Turtle.o ) Linking Turtle ... Undefined symbols: "_iconv_open", referenced from: _hs_iconv_open in libHSbase-4.2.0.2.a(iconv.o) (maybe you meant: _hs_iconv_open) "_iconv", referenced from: _hs_iconv in libHSbase-4.2.0.2.a(iconv.o) (maybe you meant: _hs_iconv_open, _hs_iconv , _hs_iconv_close ) "_iconv_close", referenced from: _hs_iconv_close in libHSbase-4.2.0.2.a(iconv.o) (maybe you meant: _hs_iconv_close) ld: symbol(s) not found collect2: ld returned 1 exit status loeki:Opgave doaitse$ Some Googling showed me that the same problem has shown up with Yi, The solution however is not there. Can someone enlighten me. Doaitse

"S. Doaitse Swierstra"
I am in my yearly fightto get a working combination of operating system (Snow Leopard), compiler version (6.12) , wxWidgets and wxHaskell on my Mac . After deleting most of my stuff, starting afresh, hours of building using macports etc. I finally get the message:
loeki:Opgave doaitse$ ghc --make Turtle.hs [1 of 1] Compiling Main ( Turtle.hs, Turtle.o ) Linking Turtle ... Undefined symbols: "_iconv_open", referenced from: _hs_iconv_open in libHSbase-4.2.0.2.a(iconv.o) (maybe you meant: _hs_iconv_open) "_iconv", referenced from: _hs_iconv in libHSbase-4.2.0.2.a(iconv.o) (maybe you meant: _hs_iconv_open, _hs_iconv , _hs_iconv_close ) "_iconv_close", referenced from: _hs_iconv_close in libHSbase-4.2.0.2.a(iconv.o) (maybe you meant: _hs_iconv_close) ld: symbol(s) not found collect2: ld returned 1 exit status loeki:Opgave doaitse$
Some Googling showed me that the same problem has shown up with Yi, The solution however is not there. Can someone enlighten me.
Have you played with:
cabal install --extra-include-dirs=/opt/local/include \
--extra-lib-dirs=/opt/local/lib ?
Note that you have to compile all of your macports stuff as 32-bit or
universal (/opt/local/etc/macports/variants.conf, uncomment
"+universal") in order for a 32-bit GHC to link with it.
G
--
Gregory Collins

Hi Doaitse, On Thu, Sep 09, 2010 at 17:38:40 +0200, S. Doaitse Swierstra wrote:
I am in my yearly fightto get a working combination of operating system (Snow Leopard), compiler version (6.12) , wxWidgets and wxHaskell on my Mac . After deleting most of my stuff, starting afresh, hours of building using macports etc. I finally get the message:
I may have had a similar problem back in March: http://www.mail-archive.com/wxhaskell-users@lists.sourceforge.net/msg00827.h... Don't know if my explanation is sensible or not. -- Eric Kow http://www.nltg.brighton.ac.uk/home/Eric.Kow For a faster response, try +44 (0)1273 64 2905 or xmpp:kowey@jabber.fr (Jabber or Google Talk only)

On Thu, Sep 9, 2010 at 17:44, Eric Y. Kow wrote:
On Thu, Sep 09, 2010 at 17:38:40 +0200, S. Doaitse Swierstra wrote:
I am in my yearly fightto get a working combination of operating system (Snow Leopard), compiler version (6.12) , wxWidgets and wxHaskell on my Mac . After deleting most of my stuff, starting afresh, hours of building using macports etc. I finally get the message:
I may have had a similar problem back in March:
http://www.mail-archive.com/wxhaskell-users@lists.sourceforge.net/msg00827.h...
Don't know if my explanation is sensible or not.
Your observation seems to agree with several other links at http://www.google.com/search?q=macports+iconv+link . Some of them suggest renaming the Mac OS X header file iconv.h (rather than not using MacPorts). Sean

See if http://stackoverflow.com/questions/2726248/ghc-6-12-and-macports/3601842#360... is of any help.

Hi!
On Thu, Sep 9, 2010 at 5:38 PM, S. Doaitse Swierstra
I am in my yearly fightto get a working combination of operating system (Snow Leopard), compiler version (6.12) , wxWidgets and wxHaskell on my Mac .
I had same problem just know and it seems to be (as described also elsewhere) that Haskell Platform GHC is linked against system's iconv and by using (or having) MacPorts or Fink with their own version you have a conflict. One solution is to get MacPorts a new version of GHC so there will be no need for Haskell Platform GHC installation if you want to use MacPorts: https://trac.macports.org/ticket/25558 (Or you could just change PATH so that it uses MacPorts version.) The other way is that you (for session in which you compile) hide MacPorts or Fink installation. I had this problem with Fink and I fixed this simply by undeclaring environment variables: export -n LD_LIBRARY_PATH export -n LIBRARY_PATH Of course then you cannot use Haskell libraries which require additional libraries not installed on the system (and this is why you install them with MacPorts or Fink). So one way would be to have Haskell Platform versions which link against MacPorts and Fink iconv (or their library paths in general). The other would be probably to implement/document configuration (extra-lib-dir?) that Cabal (or GHC in general) first searches system's library path (those against which GHC was compiled in Haskell Platform) and if lib is not there goes for MacPorts or Fink's library paths? Mitar

On 09/23/2010 10:41 PM, Mitar wrote:
The other would be probably to implement/document configuration (extra-lib-dir?) that Cabal (or GHC in general) first searches system's library path (those against which GHC was compiled in Haskell Platform) and if lib is not there goes for MacPorts or Fink's library paths?
Exactly. So, if you're in this situation, just make sure - whenever you use GHC, pass it the -L/usr/lib flag - put --extra-lib-dirs=/usr/lib in ~/.cabal/config Now Apple's libs will be preferred when linking haskell executables, solving the libiconv errors while still allowing macports libs to be used.
participants (7)
-
Eric Y. Kow
-
Gregory Collins
-
Johan Tibell
-
Mitar
-
S. Doaitse Swierstra
-
Sean Leather
-
Simon Michael