batterseapower/ansi-terminal — Issue #4: error
Author: bastik
Created: 2012-01-28 18:15:43+00:00
State: open

Importing the library does not work

$ ghc Main.hs

```
Main.o: In function `skH_info':
(.text+0x1a9): undefined reference to `__stginit_ansizmterminalzm0zi5zi5_SystemziConsoleziANSI_'
collect2: ld returned 1 exit status
```

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.12.3

```
$ cabal install ansi-terminal -v
/usr/bin/ghc --numeric-version
looking for package tool: ghc-pkg near compiler in /usr/bin
found package tool in /usr/bin/ghc-pkg
/usr/bin/ghc-pkg --version
/usr/bin/ghc --supported-languages
Reading installed packages...
/usr/bin/ghc-pkg dump --global
/usr/bin/ghc-pkg dump --user
Reading available packages...
Resolving dependencies...
selecting ansi-terminal-0.5.5 (hackage) and discarding ansi-terminal-0.1, 0.2,
0.2.1, 0.3.0, 0.3.1, 0.4.0, 0.5.0, 0.5.1, 0.5.2, 0.5.3, 0.5.4, unix-2.0 and
2.2.0.0
selecting unix-2.4.0.2 (installed or hackage) and discarding unix-2.3.0.0,
2.3.1.0, 2.3.2.0, 2.4.0.0, 2.4.0.1, 2.4.1.0, 2.4.2.0 and 2.5.0.0
selecting base-3.0.3.2 (installed) and 4.2.0.2 (installed) and discarding
syb-0.1.0.0, 0.1.0.1, 0.1.0.2, 0.1.0.3, 0.2, 0.2.1, 0.2.2, 0.3, 0.3.1, 0.3.2,
0.3.3, 0.3.4, 0.3.5 and 0.3.6
selecting ghc-prim-0.2.0.0 (installed)
selecting integer-gmp-0.2.0.1 (installed)
selecting rts-1.0 (installed)
selecting syb-0.1.0.2 (installed)
In order, the following would be installed:
ansi-terminal-0.5.5 (new package)
Downloading ansi-terminal-0.5.5...
Downloaded to
/home/te/.cabal/packages/hackage.haskell.org/ansi-terminal/0.5.5/ansi-terminal-0.5.5.tar.gz
Extracting
/home/te/.cabal/packages/hackage.haskell.org/ansi-terminal/0.5.5/ansi-terminal-0.5.5.tar.gz
to /tmp/ansi-terminal-0.5.58519...
Configuring ansi-terminal-0.5.5...
Flags chosen: example=False, splitbase=True
Dependency base ==4.2.0.2: using base-4.2.0.2
Dependency unix ==2.4.0.2: using unix-2.4.0.2
Using Cabal-1.8.0.2 compiled by ghc-6.12
Using compiler: ghc-6.12.3
Using install prefix: /home/te/.cabal
Binaries installed in: /home/te/.cabal/bin
Libraries installed in: /home/te/.cabal/lib/ansi-terminal-0.5.5/ghc-6.12.3
Private binaries installed in: /home/te/.cabal/libexec
Data files installed in: /home/te/.cabal/share/ansi-terminal-0.5.5
Documentation installed in: /home/te/.cabal/share/doc/ansi-terminal-0.5.5
Using alex version 2.3.3 found on system at: /usr/bin/alex
Using ar found on system at: /usr/bin/ar
No c2hs found
No cpphs found
No ffihugs found
Using gcc version 4.5.2 found on system at: /usr/bin/gcc
Using ghc version 6.12.3 found on system at: /usr/bin/ghc
Using ghc-pkg version 6.12.3 found on system at: /usr/bin/ghc-pkg
No greencard found
Using haddock version 2.6.1 found on system at: /usr/bin/haddock
Using happy version 1.18.4 found on system at: /usr/bin/happy
No hmake found
Using hsc2hs version 0.67 found on system at: /usr/bin/hsc2hs
No hscolour found
No hugs found
No jhc found
Using ld found on system at: /usr/bin/ld
No lhc found
No lhc-pkg found
No nhc98 found
Using pkg-config version 0.25 found on system at: /usr/bin/pkg-config
Using ranlib found on system at: /usr/bin/ranlib
Using strip found on system at: /usr/bin/strip
Using tar found on system at: /bin/tar
Creating dist/build (and its parents)
Creating dist/build/autogen (and its parents)
Preprocessing library ansi-terminal-0.5.5...
Preprocessing executables for ansi-terminal-0.5.5...
Building ansi-terminal-0.5.5...
Building library...
Creating dist/build (and its parents)
/usr/bin/ghc --make -package-name ansi-terminal-0.5.5 -hide-all-packages -fbuilding-cabal-package -i -idist/build -i. -idist/build/autogen -Idist/build/autogen -Idist/build -optP-DUNIX -optP-Iincludes -optP-include -optPdist/build/autogen/cabal_macros.h -odir dist/build -hidir dist/build -stubdir dist/build -package-id base-4.2.0.2-10bdacb430274706a59728e237e2bfb3 -package-id unix-2.4.0.2-8b7fb1ebcdcb8db413d44db018f084d7 -O -Wall -XCPP -XForeignFunctionInterface System.Console.ANSI System.Console.ANSI.Unix System.Console.ANSI.Common
[1 of 3] Compiling System.Console.ANSI.Common ( System/Console/ANSI/Common.hs, dist/build/System/Console/ANSI/Common.o )
[2 of 3] Compiling System.Console.ANSI.Unix ( System/Console/ANSI/Unix.hs, dist/build/System/Console/ANSI/Unix.o )
[3 of 3] Compiling System.Console.ANSI ( System/Console/ANSI.hs, dist/build/System/Console/ANSI.o )
Linking...
/usr/bin/ar -r dist/build/libHSansi-terminal-0.5.5.a dist/build/System/Console/ANSI.o dist/build/System/Console/ANSI/Unix.o dist/build/System/Console/ANSI/Common.o
/usr/bin/ar: creating dist/build/libHSansi-terminal-0.5.5.a
/usr/bin/ld -x -r -o dist/build/HSansi-terminal-0.5.5.o dist/build/System/Console/ANSI.o dist/build/System/Console/ANSI/Unix.o dist/build/System/Console/ANSI/Common.o
/usr/bin/ghc --abi-hash -package-name ansi-terminal-0.5.5 -hide-all-packages -fbuilding-cabal-package -i -idist/build -i. -idist/build/autogen -Idist/build/autogen -Idist/build -optP-DUNIX -optP-Iincludes -optP-include -optPdist/build/autogen/cabal_macros.h -odir dist/build -hidir dist/build -stubdir dist/build -package-id base-4.2.0.2-10bdacb430274706a59728e237e2bfb3 -package-id unix-2.4.0.2-8b7fb1ebcdcb8db413d44db018f084d7 -O -Wall -XCPP -XForeignFunctionInterface System.Console.ANSI
Registering ansi-terminal-0.5.5...
/usr/bin/ghc-pkg update - --package-conf=dist/package.conf.inplace
directory dist/doc/html/ansi-terminal does exist: False
Creating /home/te/.cabal/share/doc/ansi-terminal-0.5.5 (and its parents)
Installing LICENSE to /home/te/.cabal/share/doc/ansi-terminal-0.5.5/LICENSE
Installing library in /home/te/.cabal/lib/ansi-terminal-0.5.5/ghc-6.12.3
Creating /home/te/.cabal/lib/ansi-terminal-0.5.5/ghc-6.12.3/System/Console
(and its parents)
Creating
/home/te/.cabal/lib/ansi-terminal-0.5.5/ghc-6.12.3/System/Console/ANSI (and
its parents)
Installing dist/build/System/Console/ANSI.hi to
/home/te/.cabal/lib/ansi-terminal-0.5.5/ghc-6.12.3/System/Console/ANSI.hi
Installing dist/build/System/Console/ANSI/Unix.hi to
/home/te/.cabal/lib/ansi-terminal-0.5.5/ghc-6.12.3/System/Console/ANSI/Unix.hi
Installing dist/build/System/Console/ANSI/Common.hi to
/home/te/.cabal/lib/ansi-terminal-0.5.5/ghc-6.12.3/System/Console/ANSI/Common.hi
Creating /home/te/.cabal/lib/ansi-terminal-0.5.5/ghc-6.12.3 (and its parents)
Installing dist/build/libHSansi-terminal-0.5.5.a to
/home/te/.cabal/lib/ansi-terminal-0.5.5/ghc-6.12.3/libHSansi-terminal-0.5.5.a
Creating /home/te/.cabal/lib/ansi-terminal-0.5.5/ghc-6.12.3 (and its parents)
Installing dist/build/HSansi-terminal-0.5.5.o to
/home/te/.cabal/lib/ansi-terminal-0.5.5/ghc-6.12.3/HSansi-terminal-0.5.5.o
/usr/bin/ghc --abi-hash -package-name ansi-terminal-0.5.5 -hide-all-packages -fbuilding-cabal-package -i -idist/build -i. -idist/build/autogen -Idist/build/autogen -Idist/build -optP-DUNIX -optP-Iincludes -optP-include -optPdist/build/autogen/cabal_macros.h -odir dist/build -hidir dist/build -stubdir dist/build -package-id base-4.2.0.2-10bdacb430274706a59728e237e2bfb3 -package-id unix-2.4.0.2-8b7fb1ebcdcb8db413d44db018f084d7 -O -Wall -XCPP -XForeignFunctionInterface System.Console.ANSI
Registering ansi-terminal-0.5.5...
/usr/bin/ghc-pkg update - --user
```