Bug#335651: libsqlite-ocaml-dev: fails compilation in native code
Package: libsqlite-ocaml-dev
Version: 0.3.5.arch.4-4
Severity: normal
Given the following code in file test.ml:
let db = Sqlite.db_open "test.db" in
Sqlite.db_close db
I can compile it in bytecode using
$ ocamlc -I +sqlite sqlite.cma test.ml
without problems, but if I try to compile in native code I get
$ ocamlopt -I +sqlite sqlite.cmxa test.ml
/usr/lib/ocaml/3.08.3/sqlite/libsqlite.a(sqlite_stubs.o): In function
`raise_sqlite_error':
: undefined reference to `sqlite_freemem'
/usr/lib/ocaml/3.08.3/sqlite/libsqlite.a(sqlite_stubs.o): In function
`caml_sqlite_close':
: undefined reference to `sqlite_close'
/usr/lib/ocaml/3.08.3/sqlite/libsqlite.a(sqlite_stubs.o): In function
`caml_sqlite_finalize_gc':
: undefined reference to `sqlite_close'
/usr/lib/ocaml/3.08.3/sqlite/libsqlite.a(sqlite_stubs.o): In function
`caml_sqlite_open':
: undefined reference to `sqlite_open'
/usr/lib/ocaml/3.08.3/sqlite/libsqlite.a(sqlite_stubs.o): In function
`caml_sqlite_open':
: undefined reference to `sqlite_freemem'
/usr/lib/ocaml/3.08.3/sqlite/libsqlite.a(sqlite_stubs.o): In function
`caml_sqlite_vm_finalize_gc':
: undefined reference to `sqlite_finalize'
/usr/lib/ocaml/3.08.3/sqlite/libsqlite.a(sqlite_stubs.o): In function
`caml_sqlite_vm_finalize_gc':
: undefined reference to `sqlite_freemem'
/usr/lib/ocaml/3.08.3/sqlite/libsqlite.a(sqlite_stubs.o): In function
`caml_sqlite_vm_finalize':
: undefined reference to `sqlite_finalize'
/usr/lib/ocaml/3.08.3/sqlite/libsqlite.a(sqlite_stubs.o): In function
`caml_sqlite_vm_finalize':
: undefined reference to `sqlite_error_string'
/usr/lib/ocaml/3.08.3/sqlite/libsqlite.a(sqlite_stubs.o): In function
`caml_sqlite_compile_helper':
: undefined reference to `sqlite_compile'
/usr/lib/ocaml/3.08.3/sqlite/libsqlite.a(sqlite_stubs.o): In function
`caml_sqlite_compile_helper':
: undefined reference to `sqlite_error_string'
/usr/lib/ocaml/3.08.3/sqlite/libsqlite.a(sqlite_stubs.o): In function
`caml_sqlite_step_helper':
: undefined reference to `sqlite_step'
/usr/lib/ocaml/3.08.3/sqlite/libsqlite.a(sqlite_stubs.o): In function
`caml_sqlite_exec':
: undefined reference to `sqlite_exec'
/usr/lib/ocaml/3.08.3/sqlite/libsqlite.a(sqlite_stubs.o): In function
`caml_sqlite_exec':
: undefined reference to `sqlite_error_string'
/usr/lib/ocaml/3.08.3/sqlite/libsqlite.a(sqlite_stubs.o): In function
`caml_sqlite_last_insert_rowid':
: undefined reference to `sqlite_last_insert_rowid'
collect2: ld returned 1 exit status
Error during linking
However this works
$ ocamlopt -ccopt /usr/lib/libsqlite.so -I +sqlite sqlite.cmxa test.ml
Flavio Grossi
-- System Information:
Debian Release: testing/unstable
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.10n
Locale: LANG=it_IT@euro, LC_CTYPE=it_IT@euro (charmap=ISO-8859-15)
Versions of packages libsqlite-ocaml-dev depends on:
ii libsqlite-ocaml 0.3.5.arch.4-4 Embeddable SQL Database for OCaml
libsqlite-ocaml-dev recommends no packages.
-- no debconf information
Reply to: