[Haskell-cafe] GHC and MinGW
José Romildo Malaquias
j.romildo at gmail.com
Sat Feb 12 23:06:20 CET 2011
On Sat, Feb 12, 2011 at 01:12:22PM -0200, José Romildo Malaquias wrote:
> Hello.
>
> How do I make ghc use my installation of MinGW on Windows? I have
> ghc-7.0.1 installed and the latest MinGW packages. I want ghc to
> automatically find libraries installed by the MinGW installer.
>
> Currently I am getting the error with my application:
>
> Linking Gui.exe ...
> C:\Program Files\Haskell\iconv-0.4.1.0\ghc-7.0.1/libHSiconv-0.4.1.0.a(hsiconv.o):hsiconv.c:(.text+0x8): undefined reference to `libiconv_open'
>
> where libiconv has been installed with the command
>
> mingw-get install mingw32-libiconv
>
> and the library is available at c:/devel/MinGW/lib/
Looking at iconv.cabal from the iconv package, I found this:
if os(darwin) || os(freebsd)
-- on many systems the iconv api is part of the standard C library
-- but on some others we have to link to an external libiconv:
extra-libraries: iconv
So the problem is that the extra library iconv is not been considered
for the windows os.
Changing the line above to consider the windows os solves the problem:
if os(darwin) || os(freebsd) || os(windows)
-- on many systems the iconv api is part of the standard C library
-- but on some others we have to link to an external libiconv:
extra-libraries: iconv
Therefore the mantainer of the iconv package should fix this issue.
Romildo
More information about the Haskell-Cafe
mailing list