1

Topic: haskell: iconv on win32 - _iconv_open

Downloaded and installed iconv-1.19 in c:\iconv.

Collected package iconv-0.4.0.2 thus (just in case adding ways in INCLUDE and LIB):



runhaskell Setup configure - extra-include-dirs=c:\iconv\include - extra-lib-dirs=c:\iconv\lib 
runhaskell Setup build 
runhaskell Setup install 


But ghc something does not find:



C:\hs> ghc - make en.hs 
Linking en.exe... 
C:\ghc\iconv-0.4.0.2\ghc-6.10.4/libHSiconv-0.4.0.2.a (Internal.o):fake:(.text+0x2196): undefined reference to ` iconv_open' 
C:\ghc\iconv-0.4.0.2\ghc-6.10.4/libHSiconv-0.4.0.2.a (Internal.o):fake:(.text+0x2348): undefined reference to ` iconv_close' 
C:\ghc\iconv-0.4.0.2\ghc-6.10.4/libHSiconv-0.4.0.2.a (Internal.o):fake:(.text+0x33f3): undefined reference to ` iconv' 
collect2: ld returned 1 exit status 

ghci: 
Prelude Main>:l en.hs 
Ok, modules loaded: Main. 
Prelude Main> main 
Loading package bytestring-0.9.1.4... linking... <interactive>: C:\ghc\i 
conv-0.4.0.2\ghc-6.10.4\HSiconv-0.4.0.2.o: unknown symbol ` _iconv_open' 
: unable to load package ` bytestring-0.9.1.4' 

Prelude Main>:l eml.hs 
...
Loading package iconv-0.4.0.2... linking... <interactive>: C: \GHC \ICONV - 
0.4.0.2\ghc-6.10.4\HSiconv-0.4.0.2.o: unknown symbol ` _iconv_open' 
: unable to load package ` iconv-0.4.0.2' 


Than it is treated?

2

Re: haskell: iconv on win32 - _iconv_open

Hello, trop, you wrote:


Try so: ghc-package iconv - make en.hs

T> downloaded and installed iconv-1.19 in c:\iconv.
T> collected package iconv-0.4.0.2 thus (just in case adding ways in INCLUDE and LIB):
T>

T> runhaskell Setup configure - extra-include-dirs=c:\iconv\include - extra-lib-dirs=c:\iconv\lib 
T> runhaskell Setup build 
T> runhaskell Setup install 
T> 


T> but ghc something does not find:
T>


T> C:\hs> ghc - make en.hs 
T> Linking en.exe... 
T> C:\ghc\iconv-0.4.0.2\ghc-6.10.4/libHSiconv-0.4.0.2.a (Internal.o):fake:(.text+0x2196): undefined reference to ` iconv_open' 
T> C:\ghc\iconv-0.4.0.2\ghc-6.10.4/libHSiconv-0.4.0.2.a (Internal.o):fake:(.text+0x2348): undefined reference to ` iconv_close' 
T> C:\ghc\iconv-0.4.0.2\ghc-6.10.4/libHSiconv-0.4.0.2.a (Internal.o):fake:(.text+0x33f3): undefined reference to ` iconv' 
T> collect2: ld returned 1 exit status 

T> ghci: 
T> Prelude Main>:l en.hs 
T> Ok, modules loaded: Main. 
T> Prelude Main> main 
T> Loading package bytestring-0.9.1.4... linking... <interactive>: C:\ghc\i 
T> conv-0.4.0.2\ghc-6.10.4\HSiconv-0.4.0.2.o: unknown symbol ` _iconv_open' 
T>: unable to load package ` bytestring-0.9.1.4' 

T> Prelude Main>:l eml.hs 
T>... 
T> Loading package iconv-0.4.0.2... linking... <interactive>: C: \GHC \ICONV - 
T> 0.4.0.2\ghc-6.10.4\HSiconv-0.4.0.2.o: unknown symbol ` _iconv_open' 
T>: unable to load package ` iconv-0.4.0.2' 
T> 


T> than it is treated?

3

Re: haskell: iconv on win32 - _iconv_open

Hello, LeNsTR, you wrote:

LNT> Try so: ghc-package iconv - make en.hs




C:\hs> ghc-package iconv - make en.hs 
Linking en.exe... 
c:/ghc\iconv-0.4.0.2\ghc-6.10.4/libHSiconv-0.4.0.2.a (Internal.o):fake:(.text+0x2196): undefined reference to ` iconv_open' 
c:/ghc\iconv-0.4.0.2\ghc-6.10.4/libHSiconv-0.4.0.2.a (Internal.o):fake:(.text+0x2348): undefined reference to ` iconv_close' 
c:/ghc\iconv-0.4.0.2\ghc-6.10.4/libHSiconv-0.4.0.2.a (Internal.o):fake:(.text+0x33f3): undefined reference to ` iconv' 
collect2: ld returned 1 exit status 


It seems to me that I somehow not so installed, something did not consider.

As though ghci does not see dll/lib

4

Re: haskell: iconv on win32 - _iconv_open

PS:

The packet gathered without errors




C:\hs> ghc-pkg describe iconv 
name: iconv 
version: 0.4.0.2 
license: BSD3 
copyright: (c) 2006-2008 Duncan Coutts 
maintainer: Duncan Coutts <duncan@haskell.org> 
stability: experimental 
homepage: 
package-url: 
description: Provides an interface to the POSIX iconv library functions 
             for string encoding conversion. 
category: Text 
author: Duncan Coutts <duncan@haskell.org> 
exposed: True 
exposed-modules: Codec. Text. IConv 
hidden-modules: Codec. Text. IConv. Internal 
import-dirs: c:/ghc\iconv-0.4.0.2\ghc-6.10.4 
library-dirs: c:/ghc\iconv-0.4.0.2\ghc-6.10.4 c:\iconv\lib 
hs-libraries: HSiconv-0.4.0.2 
extra-libraries: 
extra-ghci-libraries: 
include-dirs: C:\iconv\include 
includes: iconv.h 
depends: base-4.1.0.0 bytestring-0.9.1.4 
hugs-options: 
cc-options: 
ld-options: 
framework-dirs: 
frameworks: 
haddock-interfaces: c:/ghc\doc\iconv-0.4.0.2\html\iconv.haddock 
haddock-html: c:/ghc\doc\iconv-0.4.0.2\html 





C:\iconv\lib> ls-la 
total 1021 
drwxrwxrwx 1 user group 0 Jul 26 11:36. 
drwxrwxrwx 1 user group 0 Jul 26 10:45. 
-RW-RW-RW - 1 user group 187 Oct 14 2004 charset.alias 
-RW-RW-RW - 1 user group 1024 Oct 14 2004 libcharset-bcc.lib 
-RW-RW-RW - 1 user group 3440 Oct 2 2004 libcharset.a 
-RW-RW-RW - 1 user group 3416 Oct 14 2004 libcharset.dll.a 
-RW-RW-RW - 1 user group 799 Jul 26 10:45 libcharset.la 
-RW-RW-RW - 1 user group 811 Oct 10 2004 libcharset.la.orig 
-RW-RW-RW - 1 user group 2728 Oct 14 2004 libcharset.lib 
-RW-RW-RW - 1 user group 284 Oct 14 2004 libcharset1.def 
-RW-RW-RW - 1 user group 1536 Oct 14 2004 libiconv-bcc.lib 
-RW-RW-RW - 1 user group 1009570 Oct 2 2004 libiconv.a 
-RW-RW-RW - 1 user group 8230 Oct 14 2004 libiconv.dll.a 
-RW-RW-RW - 1 user group 791 Jul 26 10:45 libiconv.la 
-RW-RW-RW - 1 user group 803 Oct 10 2004 libiconv.la.orig 
-RW-RW-RW - 1 user group 4216 Oct 14 2004 libiconv.lib 
-RW-RW-RW - 1 user group 474 Oct 14 2004 libiconv2.def 

C:\iconv\include> ls-la 
total 10 
drwxrwxrwx 1 user group 0 Jul 26 10:45. 
drwxrwxrwx 1 user group 0 Jul 26 10:45. 
-RW-RW-RW - 1 user group 5309 Oct 2 2004 iconv.h 
-RW-RW-RW - 1 user group 1838 Oct 2 2004 libcharset.h 
-RW-RW-RW - 1 user group 1682 Oct 2 2004 localcharset.h 

C:\iconv\bin> ls-la 
total 1085 
drwxrwxrwx 1 user group 0 Jul 26 10:45. 
drwxrwxrwx 1 user group 0 Jul 26 10:45. 
-rwxrwxrwx 1 user group 16896 Oct 14 2004 iconv.exe 
-RW-RW-RW - 1 user group 11776 Oct 14 2004 libcharset1.dll 
-RW-RW-RW - 1 user group 978432 Oct 14 2004 libiconv2.dll 
-RW-RW-RW - 1 user group 101888 Oct 9 2004 libintl3.dll 

5

Re: haskell: iconv on win32 - _iconv_open

Lifted ubuntu on vmware, there all works

6

Re: haskell: iconv on win32 - _iconv_open

Hello, trop, you wrote:

T> lifted ubuntu on vmware, there all works


All right, persuaded. It is necessary to look simply iconv.cabal.


There it is written:



  if os (darwin) || os (freebsd) 
    -- on many systems the iconv api is part of the standard A C library 
    -- but on some others we have to link to an external libiconv: 
    extra-libraries: iconv 



The Windows - not darwin and not freebsd and iconv api on it not is "part of the standard a C library". Further to explain?

7

Re: haskell: iconv on win32 - _iconv_open

Hello, awson, you wrote:

A> the Windows  not darwin and not freebsd and iconv api on it not is "part of the standard a C library". Further to explain?


It turns out that on Windows even installed libiconv does not promote

8

Re: haskell: iconv on win32 - _iconv_open

Hello, trop, you wrote:

T> it turns out that on Windows even installed libiconv does not promote


Well you give. Simply remove if and leave

extra-libraries: iconv 

.

9

Re: haskell: iconv on win32 - _iconv_open

Hello, awson, you wrote:

A> Hello, trop, you wrote:
T>> it turns out that on Windows even installed libiconv does not promote
A> Well you give. Simply remove if and leave

extra-libraries: iconv 

.


So on Windows manually put, without cabal,

It gathered and delivered without errors, but the code with iconv not .

How to cure and did not understand.


On a tench all works.