Missing shared library for GHC-HDBC-Sqlite3

Bug #518709 reported by Federico Zenith
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
hdbc-sqlite3 (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Sqlite3 interface for Haskell (HDBC) is not working due to missing file (at least that's what GHCI says); steps to reproduce:

$ sudo aptitude install ghc6 libghc6-hdbc-sqlite3-dev
$ ghci
Prelude> :module Database.HDBC Database.HDBC.Sqlite3
Prelude> conn <- connectSqlite3 "test1.db"
[ ... lots of linking messages ... ]
Loading package HDBC-sqlite3-2.1.0.2 ... can't load .so/.DLL for: HSHDBC-sqlite3-2.1.0.2 (libHSHDBC-sqlite3-2.1.0.2.so: cannot open shared object file: No such file or directory)

Compiling the following file with GHC:

import Database.HDBC
import Database.HDBC.Sqlite3
main :: IO ()
main = do conn <- connectSqlite3 "test1.db"
          return ()

results in:

test.o: In function `s1pq_info':
(.text+0xc5): undefined reference to `HDBCzmsqlite3zm2zi1zi0zi2_DatabaseziHDBCziSqlite3ziConnection_connectSqlite3_closure'
test.o: In function `s1pq_info':
(.text+0x1df): undefined reference to `__stginit_HDBCzm2zi1zi0_DatabaseziHDBC_'
test.o: In function `s1pq_info':
(.text+0x1e9): undefined reference to `__stginit_HDBCzmsqlite3zm2zi1zi0zi2_DatabaseziHDBCziSqlite3_'
test.o: In function `s1pq_srt':
(.data+0x10): undefined reference to `HDBCzmsqlite3zm2zi1zi0zi2_DatabaseziHDBCziSqlite3ziConnection_connectSqlite3_closure'
collect2: ld returned 1 exit status

Ubuntu version: Kubuntu 9.10
Package versions: ghc6 6.10.4-1ubuntu2, libghc6-hdbc-sqlite3-dev 2.1.0.2-1

Revision history for this message
StefanPotyra (sistpoty) wrote :

Hi,

you'll need to specify the package:

compiling it with
ghc6 -package HDBC-sqlite3-2.1.0.2 test.hs -o test.bin

works like a charm for me.

Cheers,
    Stefan.

Revision history for this message
StefanPotyra (sistpoty) wrote :

marking as invalid for now. Please reopen if you still see the problem.

Cheers,
   Stefan.

Changed in hdbc-sqlite3 (Ubuntu):
status: New → Invalid
Revision history for this message
Jeff (palmje) wrote :

Using ghc works without any issues, but using ghci doesn't. Looking at the files that are installed, I can see the libHSHDBC-sqlite3-2.1.0.2.a file, which will be use to compile into the executable, but there is no .so file for dynamic linking, as done by ghci.

The solution to this should be as simple as generating the shared object and including it in the package.

Changed in hdbc-sqlite3 (Ubuntu):
status: Invalid → Confirmed
Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

it works now to me

Changed in hdbc-sqlite3 (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.