caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Error linking sqlite
@ 2005-10-24  8:57 Flavio
  2005-10-24 12:22 ` [Caml-list] " Richard Jones
  0 siblings, 1 reply; 4+ messages in thread
From: Flavio @ 2005-10-24  8:57 UTC (permalink / raw)
  To: caml-list

Hello all,
I'm having problems compiling programs using sqlite library on debian 
unstable. Given the following code in file prova.ml:

let db = Sqlite.db_open "prova" in
Sqlite.db_close db

I can compile it in bytecode using

ocamlfind ocamlc -package sqlite -linkpkg prova.ml

without problems, but if I try to compile in native code with

ocamlfind ocamlopt -package sqlite -linkpkg prova.ml

I get

/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

Is this a bug in the debian package? I tried both libsqlite-ocaml-dev version  
0.3.5.arch.4-4 and version 0.3.5.arch.4-3

Many thanks,
Flavio

	

	
		
___________________________________ 
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB 
http://mail.yahoo.it


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] Error linking sqlite
  2005-10-24  8:57 Error linking sqlite Flavio
@ 2005-10-24 12:22 ` Richard Jones
  2005-10-24 15:15   ` Flavio
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Jones @ 2005-10-24 12:22 UTC (permalink / raw)
  To: 6degreesoit; +Cc: caml-list

On Mon, Oct 24, 2005 at 10:57:49AM +0200, Flavio wrote:
> ocamlfind ocamlopt -package sqlite -linkpkg prova.ml
>
> Is this a bug in the debian package? I tried both
> libsqlite-ocaml-dev version 0.3.5.arch.4-4 and version
> 0.3.5.arch.4-3

I think it might be because the Ocaml stubs are linked to a file
called libsqlite.a, which has the same name as the sqlite library
itself (/usr/lib/libsqlite.so), thus confusing the C linker.

Rich.

-- 
Richard Jones, CTO Merjis Ltd.
Merjis - web marketing and technology - http://merjis.com
Team Notepad - intranets and extranets for business - http://team-notepad.com


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] Error linking sqlite
  2005-10-24 12:22 ` [Caml-list] " Richard Jones
@ 2005-10-24 15:15   ` Flavio
       [not found]     ` <6b8a91420510240902o4d8ac14fr@mail.gmail.com>
  0 siblings, 1 reply; 4+ messages in thread
From: Flavio @ 2005-10-24 15:15 UTC (permalink / raw)
  To: caml-list

Alle 14:22, lunedì 24 ottobre 2005, Richard Jones ha scritto:
> On Mon, Oct 24, 2005 at 10:57:49AM +0200, Flavio wrote:
> > ocamlfind ocamlopt -package sqlite -linkpkg prova.ml
> >
> > Is this a bug in the debian package? I tried both
> > libsqlite-ocaml-dev version 0.3.5.arch.4-4 and version
> > 0.3.5.arch.4-3
>
> I think it might be because the Ocaml stubs are linked to a file
> called libsqlite.a, which has the same name as the sqlite library
> itself (/usr/lib/libsqlite.so), thus confusing the C linker.

Thank you, all works fine if I add "-ccopt /usr/lib/libsqlite.so" when 
compiling.

But is this behaviour intended? Should I fill a bug report? (I ask here 
because it seems that there are debian package maintainers for ocaml on this 
list)

Flavio





___________________________________
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB
http://mail.yahoo.it


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] Error linking sqlite
       [not found]     ` <6b8a91420510240902o4d8ac14fr@mail.gmail.com>
@ 2005-10-24 16:04       ` Remi Vanicat
  0 siblings, 0 replies; 4+ messages in thread
From: Remi Vanicat @ 2005-10-24 16:04 UTC (permalink / raw)
  To: caml-list

2005/10/24, Flavio <sixdegreesoit@yahoo.it>:
>
> But is this behaviour intended? Should I fill a bug report? (I ask here
> because it seems that there are debian package maintainers for ocaml on this
> list)

Please, do submit a bug report about it, we (well more probably the
others Debian maintainers) will look at it.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-10-24 16:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-24  8:57 Error linking sqlite Flavio
2005-10-24 12:22 ` [Caml-list] " Richard Jones
2005-10-24 15:15   ` Flavio
     [not found]     ` <6b8a91420510240902o4d8ac14fr@mail.gmail.com>
2005-10-24 16:04       ` Remi Vanicat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).