Linker errors when using HaskellDB on HSQL
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
haskelldb (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: libghc6-
I've installed the GHC6, HSQL and HaskellDB Ubuntu-packages. I wrote a little test program (DBTest.hs) which is meant to simply dump the list of tables in a test database that I have. But, whether I try to run this program interactively or compile it, I get linker errors. My guess is that something about the installation of the HaskellDB Haskell-package means it isn't aware that it needs to link against the database-specific HSQL Haskell-packages, since the symbols that it is unable to find are certainly present in the HSQL libraries. It could be that the HaskellDB Ubuntu-package hasn't been updated since HSQL was split into several Haskell-packages. The symptoms are as follows:
$ dpkg --list "libghc6-h*"
Desired=
| Status=
|/ Err?=(none)
||/ Name Version Description
+++-===
un libghc6-
un libghc6-
ii libghc6-
un libghc6-hgl-dev <none> (no description available)
ii libghc6-hsql-dev 1.6-5ubuntu4 Multi-Database Interface System for Haskell
ii libghc6-
ii libghc6-
ii libghc6-
pn libghc6-
un libghc6-
un libghc6-hunit-dev <none> (no description available)
$ ghc-pkg list
/usr/lib/
rts-1.0, base-1.0, haskell98-1.0, template-
Cabal-1.0, parsec-1.0, haskell-src-1.0, network-1.0,
QuickCheck-1.0, HUnit-1.1, mtl-1.0, fgl-5.2, X11-1.1, HGL-3.1,
stm-1.0, readline-1.0, (lang-1.0), (concurrent-1.0), (posix-1.0),
(util-1.0), (data-1.0), (text-1.0), (net-1.0), (hssource-1.0),
hsql-1.6, hsql-mysql-1.6, hsql-odbc-1.6, hsql-postgresql
haskelldb-0.9
$ cat DBTest.hs
module Main where
import Database.HaskellDB
import Database.
opts = MySQLOptions { server="localhost", db="mydatabase", uid="myuser", pwd="mypassword" }
main' db = do
tbls <- tables db
mapM_ putStrLn tbls
main :: IO ()
main = mysqlConnect opts main'
$ ghci
___ ___ _
/ _ \ /\ /\/ __(_)
/ /_\// /_/ / / | | GHC Interactive, version 6.4.1, for Haskell 98.
/ /_\\/ __ / /___| | http://
\____/\/ /_/\____/|_| Type :? for help.
Loading package base-1.0 ... linking ... done.
Prelude> :l DBTest.hs
Skipping Main ( DBTest.hs, DBTest.o )
Ok, modules loaded: Main.
Prelude Main> main
Loading package hsql-1.6 ... linking ... done.
Loading package haskelldb-0.9 ... linking ... <interactive>: /usr/lib/
$ ghc --make DBTest.hs
Chasing modules from: DBTest.hs
Skipping Main ( DBTest.hs, DBTest.o )
Linking ...
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
collect2: ld returned 1 exit status
Hi George. Have you tried a more recent version of Ubuntu, to see if this problem still exists? Thanks.