22

I am trying to use the text-icu library as a dependency in a cabal package on Mac OS. I have icu installed but when I try to build my package cabal gives me this error:

  • Missing C libraries: icui18n, icudata, icuuc

I'm am unsure what debugging steps to use.

user945202
  • 221
  • 1
  • 3

1 Answers1

26

You can use either MacPorts or Homebrew to install the icu package, and have cabal refer to the custom header and library path:

MacPorts

sudo port install icu
cabal install text-icu --extra-include-dirs=/opt/local/include --extra-lib-dirs=/opt/local/lib

Homebrew

brew install icu4c
cabal install text-icu --extra-lib-dirs=/usr/local/opt/icu4c/lib --extra-include-dirs=/usr/local/opt/icu4c/include
Ayub
  • 989
  • 10
  • 12
  • 21
    Or you can use `brew install icu4c`. Then, installing the cabal package with `cabal install text-icu --extra-lib-dirs=/usr/local/opt/icu4c/lib --extra-include-dirs=/usr/local/opt/icu4c/include` – ivanjovanovic Jun 10 '13 at 22:26
  • @danza - I did just that. – Sridhar Ratnakumar Mar 28 '15 at 06:11
  • 9
    Note that it works exactly the same with Stack, just replace `cabal` with `stack`. For instance, if you installed the library with Homebrew, use `stack install text-icu --extra-lib-dirs=/usr/local/opt/icu4c/lib --extra-include-dirs=/usr/local/opt/icu4c/include` – danza Sep 30 '15 at 09:14