haskell / text-icu

This package provides the Haskell Data.Text.ICU library, for performing complex manipulation of Unicode text.
BSD 2-Clause "Simplified" License
47 stars 42 forks source link

How to statically link on Windows? #29

Open doivosevic opened 7 years ago

doivosevic commented 7 years ago

Hi, I'm aware that this is not a problem specific for this library but I think Haskell generally has a problem that this information is hard to find and this is the first library I'm using that's supposed to used satically linked files. How do I include this into my project?

I did stack install text-icu --extra-include-dirs=C:\msys64\icu4c-59_1-Win64-MSVC2015\include --extra-lib-dirs=C:\msys64\icu4c-59_1-Win64-MSVC2015\lib64

and I tried putting the dll into my .stack-work\install\28cbf0ed\bin folder but when I try stack build I get


ghc.EXE: unable to load package `text-icu-0.7.0.1'
ghc.EXE: addDLL: icuuc59.dll (Win32 error 126): The specified module could not be found.
ghc.EXE: Could not load `icuuc59.dll'. Reason: addDLL: could not load DLL
alanz commented 7 years ago

From https://github.com/alanz/haskell-lsp/issues/41#issuecomment-316681546

" Thanks for your help, I got it building, although not by using pacman. Here are the steps:

Download ICU4C for Windows 64-bit from the download page here. The newest version (59.1 at the time of writing, direct link here) is just fine.
Extract the archive to some location, lets say C:\icu.
Open a terminal, navigate to C:\icu\bin64
Make a symbolic link: mklink icudt.dll icudt59.dll
Make a symbolic link: mklink icuin.dll icuin59.dll
Make a symbolic link: mklink icuuc.dll icuuc59.dll
Then clone the repository and build it with some additional references to the extracted archive:

git clone https://github.com/alanz/haskell-lsp cd haskell-lsp stack build --extra-include-dirs="C:\icu\include" --extra-lib-dirs="C:\icu\lib64" --extra-lib-dirs="C:\icu\bin64" "

Perhaps these instructions (or similar) should be added to the README.