Hi David

I've also used ghc for years on Mac OS and have also never seen this problem. I don't use nix. Currently I am on ghc 9.0.1. and Mac OS 11.6. I installed from  

    https://downloads.haskell.org/ghc/9.0.1/


Are any of the following env variables defined on your system?

       LD_LIBRARY_PATH, DYLD_LIBRARY_PATH, and DYLD_FALLBACK_LIBRARY_PATH

None are defined on my system which I think is normal.

When you type 

  iconv --version 

What output do you get? I get 

 iconv --version
iconv (GNU libiconv 1.11)
Copyright (C) 2000-2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Bruno Haible.

Not sure if my questions will help but I think there is something unusual about your system configuration.

Cheers
George



On Mon, Oct 11, 2021 at 9:38 AM Dominic Steinitz <dominic@steinitz.org> wrote:
Hi David

I am a long time user of ghc on OSX. I have seen that problem but never on native OSX only when using nix (and then I added it explicitly).

Two things spring to mind:
  1. Add it explicitly on the compile command `-liconv`
  2. Use nix and then you can control the build environment in a totally controllable and reproducible manner. This is actually easier than it sounds: `curl https://nixos.org/nix/install | sh` and `nix-env -I ghc`. If you get the same error with that then we can try adding `iconv` explicitly.
 Dominic Steinitz
dominic@steinitz.org
http://idontgetoutmuch.org
Twitter: @idontgetoutmuch


I have a conundrum on which advice would be appreciate. Does
anyone know how to successfully install ghc on OSX
I've tried various binary instalation routes:
macports, brew, direct binary downloads from haskel.org
All have the same result. when I try to compile a basic hello world program
I get

Undefined symbols for architecture x86_64:
 "_iconv", referenced from:


I've triedgiong  through ghcup

8.8.4
8.6.5.
8.10.2
8.10.7
9.0.1

all have the same problem.
I'd be happy to build from source. Small problem: what Haskell compiler do
I use?

Any advice on installs that works along with any changes to paths to avoid
the iconv problems would be appreciated as currently my Haskell-related
activities have come to a grinding halt. Switchig to a different OS would
be nice but its not a
feasible option a at present.Writing a compiler is starting to look
attractive..

thanks
David

--
David Duke
Emeritus Professor of Computer Science
School of Computing University of Leeds UK
E:duke.j.david@gmail.com
W:https://engineering.leeds.ac.uk/staff/334/Professor_David_Duke

_______________________________________________
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users